Compare commits

...

7723 Commits

Author SHA1 Message Date
a7ae33202f Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/space_userpref.py
	source/blender/blenkernel/BKE_gpencil.h
	source/blender/blenkernel/BKE_gpencil_update_cache.h
	source/blender/blenkernel/CMakeLists.txt
	source/blender/blenkernel/intern/gpencil.c
	source/blender/blenkernel/intern/gpencil_update_cache.c
	source/blender/blenlib/BLI_listbase.h
	source/blender/blenlib/intern/DLRB_tree.c
	source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
	source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_gpencil.cc
	source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_gpencil.h
	source/blender/makesdna/DNA_gpencil_types.h
	source/blender/makesrna/intern/rna_gpencil.c
2022-02-10 16:59:57 +01:00
ad77b52abc Correction to previous Clang strict warning commit
Need to only pop diagnostic if it was really pushed.

Pointed out by Aras Pranckevicius, thanks!
2022-02-10 16:05:11 +01:00
b73c265974 Merge branch 'blender-v3.1-release' 2022-02-10 16:04:50 +01:00
94f0230230 Fix T95666: Crash when attempting multires linear subdivide
The crash was happening when the mesh had loose edges.

Loose edges are not part of OpenSubdiv topology and hence should not be
communicated to the refiner. Pass ta boolean flag indicating whether an
edge is loose or not in the mesh foreach routines, which seems to be
the easiest way.
2022-02-10 15:51:19 +01:00
e9c9a2183d LibOverride: Fix/improve handling of hierarchy root in tagged creation.
Decouple the reference (linked) root ID and the hierarchy (override) root ID.
Previous code was assuming that the reference ID was always also tagged
for override creation, which is true in current master, but cannot be
assumed in general (and won't be true with partial resync anymore).

Also add asserts to validate conditions that the reference/hierarchy_root
variables must meet.
2022-02-10 14:55:12 +01:00
d16e5babaf Merge branch 'blender-v3.1-release' 2022-02-10 14:12:35 +01:00
04d55038ee Fix size_t -> int -> size_t round trip in Cycles
There are two things achieved by this change:

- No possible downcast of size_t to int when calculating motion steps.
- Disambiguate call to `min()` which was for some reason considered
  ambiguous on 32bit platforms `min(int, unsigned int)`.
- Do the same for the `max()` call to keep them symmetrical.

On an implementation side the `min()` is defined for a fixed width
integer type to disambiguate uint from size_t on 32bit platforms,
and yet be able to use it for 32bit operands on 64bit platforms without
upcast.

This ended up in a bit bigger change as the conditional compile-in of
functions is easiest if the functions is templated. Making the functions
templated required to remove the other source of ambiguity which is
`algorithm.h` which was pulling min/max from std.

Now it is the `math.h` which is the source of truth for min/max.
It was only one place which was relying on `algorithm.h` for these
functions, hence the choice of `math.h` as the safest and least
intrusive.

Fixes 32bit platforms (such as i386) in Debian package build system.

Differential Revision: https://developer.blender.org/D14062
2022-02-10 12:39:41 +01:00
87d2de88fd Fix T95664: missing update after changing active output node 2022-02-10 12:07:48 +01:00
e2befa425a GPencil: Update-on-write using update cache
This implements the update cache described in T95401.

The cache is currently only used for drawing strokes and
sculpting (using the push brush).
**Note: Making use of the cache throughout grease pencil will
have to be done incrementally in other patches. **

The update cache stores what elements have changed in the
original data-block since the last time the eval object
was updated. Additionally, the update cache can store multiple
updates to the data and minimizes the number of elements
that need to be copied.

Elements can be tagged using `BKE_gpencil_tag_full_update` and
`BKE_gpencil_tag_light_update`. A full update means that the element
itself will be copied but also all of the content inside. E.g. when a
layer is tagged for a full update, the layer, all the frames inside the
layer and all the strokes inside the frames will be copied.
A light update means that only the properties of the element are copied
without any of the content. E.g. if a layer is tagged with a light
update, it will copy the layer name, opacity, transform, etc.

When the update cache is in use (e.g. elements have been tagged) then
the depsgraph will not trigger a copy-on-write, but an update-on-write.
This means that the update cache will be used to determine what elements
have changed and then only those elements will be copied over to the
eval object.

If the update cache is empty or the data block was tagged with a full
update, we always fall back to a copy-on-write.

Currently, the update cache is only used by the active depsgraph. This
is because we need to free the update cache after an update-on-write so
it's reset and we need to make sure it is not freed or read by other
depsgraphs.

Co-authored-by: @yann-lty
This patch was contributed by The SPA Studios.

Reviewed By: sergey, antoniov, #dependency_graph, pepeland, mendio

Maniphest Tasks: T95401

Differential Revision: https://developer.blender.org/D13984
2022-02-10 11:35:56 +01:00
84f30ac3a2 Deps: upgrade OpenXR 1.0.17 -> 1.0.22
Simple upgrade of OpenXR to 1.0.22, following the steps from
https://wiki.blender.org/wiki/Source/OpenXR_SDK_Dependency and
rBb69ab42982a1. No changes to Blender code were necessary, only a version
bump.

The primary motivation for this upgrade is to utilize the
`XR_HTCX_vive_tracker_interaction` extension introduced in ver. 1.0.20.
However, the latest release (1.0.22) also adds a number of potentially
useful extensions such as:
- `XR_FB_render_model`
- `XR_HTC_facial_expression`
- `XR_HTC_vive_focus3_controller_interaction`

Ref T95206

Reviewed By: LazyDodo, sybren, mont29

Maniphest Tasks: T95206

Differential Revision: https://developer.blender.org/D13950
2022-02-10 19:15:29 +09:00
Brad Clark
26740aaf51 Fix T84486: NLA, disable "Sync Length" after split
Turn off "Sync Length" when splitting an NLA strip.

The NLA Strip-Action Clip has a setting called "Sync Length" that is on
by default and helps to update the length of the clip to the current
actions keyframes so the strip shows the entire actions stored
animation.

When you split one of these strip-action clips in the NLA to trim it
shorter or to move it somewhere else in the NLA tracks to blend or work
with, the "Sync Length" setting stays checked on.  You can have many
strips in the NLA that all look to the same action, if you split one
strip , you now have two strips showing or linked to the same action.

To see or edit keyframes on a strip, you enter tweak mode. When you exit
tweak mode, if "Sync Length" is active on the strip-action clip
settings, the strip length is changed/reset to match the action keys.
When you have many clips, this causes all of them to evaluate and update
no matter where they are in the NLA.  This destroys/undoes all the user
work to trim down and place the clips in the NLA.

**Description of the proposed solution:**

This patch/change would turn off, the "Sync Length" setting when the
split tool was used on a strip/action clip to help protect the users
choice to trim and keep the clip that length. It doesn't change the
ability to turn the setting back on or off, it just makes sure that the
user doesn't accidentally or unknowingly loose work.

The same process happens when an action is created that has a "manual
range" set that is different than the length of the actions start-end
keyframes. It makes sense to do the same thing for the split tool.

**Alternative solutions:**

While the user could know this and turn off this setting by hand, it is
easy to forget and or the user might think that it only happened to the
one clip they were editing and not realize it happened to all the
trimmed versions, changing the users choice without the user knowing it
happened.

**Limitations of the proposed solution:**

It only fixes the split tool, if another tool was created and some how
impacted the clip length we would need to have that tool also take the
sync length into account.

Reviewed By: sybren

Maniphest Tasks: T84486

Differential Revision: https://developer.blender.org/D10168
2022-02-10 11:08:00 +01:00
9e9355190c Fix compilation with strict Clang flags
There is no `-Wformat-truncation` warning in Clang, so tweak checks
around diagnostics pragma accordingly.
2022-02-10 10:55:50 +01:00
8c18b16829 Merge branch 'blender-v3.1-release' 2022-02-10 10:48:06 +01:00
5312cf50a1 Fix strict warning initializing texture result in compositor
From a strict language point of view the code required a braces around
`trgba` initialization. But it is easier to rely on the fact that fields
which are not specified are zero-initialized.
2022-02-10 10:46:06 +01:00
507a4deef1 Fix invalid creation of partial image updater 2022-02-10 10:42:25 +01:00
e6ad11f06d Cleanup: quiet warnings including RE_pipeline.h directly 2022-02-10 16:45:54 +11:00
c824c06f38 Cleanup: Clang tidy, unused variabel warnings 2022-02-09 23:07:48 -06:00
2887df119c Fix: Complete curves renaming missed in previous commit
This made cycles not render curves. Missed in fe1816f67f
2022-02-09 17:56:19 -06:00
fe80ff446f Cleanup: copyright in headers, spelling in comments
- Order year consistently.
- Minor consistency (case, double-spacing).
- Correct typos.
2022-02-10 10:25:06 +11:00
58761eb11a GNUmakefile: move editor settings to .editorconfig
Remove inline vim/emacs editor configuration,
add makefile to editorconfig instead.
2022-02-10 09:20:34 +11:00
7b0174ef81 Cleanup: remove overly detailed contact info, correct md5 copyright
Also remove copyright text with no assignment.
2022-02-10 09:05:40 +11:00
e420514892 Merge branch 'blender-v3.1-release' 2022-02-09 11:06:34 -06:00
d1202bd641 Fix T95620: Crash When Entering Edit Mode on a Curve
Under some circumstances, simply adding a curve object and going
to edit mode would cause a crash. This is because the evaluated
`CurveEval` was accessed but also freed by the dependency graph.

The fix reverts the part of b76918717d that uses the
`CurveEval` for the curve object bounds. While this isn't ideal,
it was the previous behavior, and some unexpected behavior
with object bounds is much better than a crash. Plus, given the plans
of using the new "Curves" data-block for evaluated curves, this
situation will change relatively soon anyway.
2022-02-09 11:06:10 -06:00
6e14be858c Merge branch 'blender-v3.1-release' 2022-02-09 16:16:34 +01:00
c69ee218d7 Revert "Fix size_t -> int -> size_t round trip in Cycles"
This reverts commit d74bb7be19.

Need to re-iterate to have a proper support of all platforms.
2022-02-09 16:16:21 +01:00
3e67831d3f VSE: Fix sound strip not aligned with movie strip
Strip aligning wasn't done when length of 2 strip is equal, but since
these strips are aligned according to position in stream this can
produce offset.
2022-02-09 16:06:56 +01:00
e098a29606 Merge branch 'blender-v3.1-release' 2022-02-09 15:54:41 +01:00
7313a84c5a Fix T95612: only overwrite existing attributes with matching domain and type
Also fixes T95611 and T95610.

Differential Revision: https://developer.blender.org/D14051
2022-02-09 15:50:03 +01:00
669d3bbad6 Merge branch 'blender-v3.1-release' 2022-02-09 14:46:00 +01:00
d74bb7be19 Fix size_t -> int -> size_t round trip in Cycles
There are two things achieved by this change:

- No possible downcast of size_t to int when calculating motion steps.
- Disambiguate call to min() which was for some reason considered
  ambiguous on 32bit platforms `min(int, unsigned int)`.

On an implementation side the `min()` is defined for a fixed width
integer type to disambiguate uint from size_t on 32bit platforms,
and yet be able to use it for 32bit operands on 64bit platforms without
upcast.

Fixes 32bit platforms (such as i386) in Debian package build system.

Differential Revision: https://developer.blender.org/D13992
2022-02-09 14:45:39 +01:00
3577ccc9c0 Cleanup: Add newline in error message.
Increases readability during debugging.
2022-02-09 14:09:04 +01:00
6345032a49 Cleanup: non-standard license formatting, minor changes 2022-02-09 23:57:12 +11:00
312d6925c4 Cleanup: make file headers more consistent
Also some descriptive text into doc-strings.
2022-02-09 23:47:34 +11:00
b4700a13c6 VSE: Use float for transformation offset
When image position is animated, float makes movement look smoother.
2022-02-09 13:42:58 +01:00
7c10e364b2 BLI: wrap parallel_invoke from tbb 2022-02-09 13:08:04 +01:00
3f061ef050 Merge branch 'blender-v3.1-release' 2022-02-09 12:38:08 +01:00
d82384f7e1 Fix T95640: missing null check in previous commit 2022-02-09 12:36:49 +01:00
312c8fdaf9 Cleanup: Better naming in lib_remap.
Renames is_never_null to violates_never_null.
2022-02-09 11:44:14 +01:00
Alaska
fd6506626b Adjust "Show Backface" tool tip to be more accurate
Reviewed By: fclem

Differential Revision: https://developer.blender.org/D13849
2022-02-09 11:28:39 +01:00
Alaska
d3d9e2abbf Fix small grammatical mistake in Refraction Depth tooltip
Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D13850
2022-02-09 11:26:21 +01:00
bfacb22a93 Merge branch 'blender-v3.1-release' 2022-02-09 11:20:51 +01:00
06ac599261 Fix T91840: do not create invalid links when inserting a node
Differential Revision: https://developer.blender.org/D14050
2022-02-09 11:19:23 +01:00
Colin Basnett
6f01758b47 Added a "Sharpen Less" kernel for the Filter Compositor node
Added a new "Sharpen Less" kernel to the filter compositor node. The intent here is to provide a much less aggressive sharpening filter that can't simply be solved by toning down the factor on the existing sharpen filter.

The existing "Sharpen" filter uses a "box" kernel:

```
-1 -1 -1
-1  9 -1
-1 -1 -1
```

The new "Sharpen Less" filter uses a "diamond" kernel:

```
 0 -1  0
-1  5 -1
 0 -1  0
```

The difference between the two is clear to see in the following side-by-side:

{F12847431}

Below shows the difference between the filtering kernels as applied to a B&W render of Suzanne with the UV grid as a texture. The left side of the render using the existing "Sharpen" filter, and the right side showing the new "Sharpen Less" filter. Notice that the left side is more aggressive in accentuating localized contrasts across the image. This can lead to what appears to be aliasing or striations in the resulting image:

{F12847429}

https://developer.blender.org/T95275
https://blender.community/c/rightclickselect/57Kq/?sorting=hot
{F12847428}

Reviewed By: #compositing, jbakker

Differential Revision: https://developer.blender.org/D14019
2022-02-09 10:28:00 +01:00
81da638c44 Cleanup: move file descriptions into doxygen file section
Continuation of 19100aa57d.
2022-02-09 18:33:29 +11:00
19100aa57d Cleanup: move file descriptions into doxygen file section
Also other minor corrections & reformat particle system copyright.
2022-02-09 18:10:43 +11:00
2c7f2a0ba4 Cleanup: simplify copyright headers for sequence & imbuf 2022-02-09 16:47:15 +11:00
68a21697be Cleanup: remove "The Original Code is: ..." from code comments
This is almost always meaningless as most code has changed
since the comment was added. Besides this, version control can be used
to check if/when a file was modified.

Some cases of this were kept when they contain details
about the original copyright holder.
2022-02-09 16:04:31 +11:00
59a7095f79 Cleanup: use consistent copyright location, move descriptions
Order copyright immediately after the license block,
this was done almost everywhere with a few exceptions.

Remove authors from a few files (we had already removed "Contributors"
section however with old patches being applied this gets added back in).

Also move descriptive text into the doxygen comment block under \file.
In some cases remove the text as it was accidentally copied.
2022-02-09 16:00:16 +11:00
Shrey Aggarwal
f021d46752 Cleanup: GHOST_ISystem::toggleConsole API
GHOST_ISystem::toggleConsole had a somewhat misleading name
it could be fed 4 different values, so it was not as much a
toggle as a set console window state.

This change renames `toggleConsole` to a more appropriately
named `setConsoleWindowState` and replaces the integer it had
to an enum so it's easy to tell what is being asked of it at
the call site.

Reviewed By: LazyDodo
Differential Revision: https://developer.blender.org/D14020
2022-02-08 17:40:48 -07:00
Paolo Acampora
452a7f6731 Fix T91871: Symmetrize Armature on custom bone shape
Symmetrize Armature now also symmetrizes the transform of custom bone
shapes.

Adds a new property to `bpy.ops.armature.symmetrize`:

//Parameters//:

- **direction **(enum in ['NEGATIVE_X', 'POSITIVE_X'], (optional)) –
  **Direction**, Which sides to copy from and to (when both are selected)

- **custom_shape **(enum in ['SYMMETRIZE_SAME', 'SYMMETRIZE_ALL',
  'SYMMETRIZE_NONE'], (optional)) – **Custom Shapes**, Wether to
  symmetrize non symmetric custom bone shapes, all custom shapes, or
  none at all

//Rationale//:

Reviewed By: #animation_rigging, Mets, sybren

Maniphest Tasks: T91871

Differential Revision: https://developer.blender.org/D13416
2022-02-08 18:09:48 +01:00
55c90df316 BLF: Enable Filtering of woff and woff2 Fonts
Add files with extension ".woff" and ".woff2" to FILE_TYPE_FTFONT
file type. Allows selecting and using these types of font files.

See D13822 for more details.

Differential Revision: https://developer.blender.org/D13822

Reviewed by Campbell Barton
2022-02-08 08:43:01 -08:00
5d9d2565d2 Cleanup: simplify DNA genfile casting
Avoid using the uint64_t as an intermediate cast since it complicates
behavior for signed types (which first need to be cast to an int64_t).

Assign both old_value_i & old_value_f from the original value to avoid
the need for different handling of signed/unsigned types.

Reviewed By: JacquesLucke

Ref D14039
2022-02-08 22:52:46 +11:00
460d1a4cb3 Eevee: support the no-op Bump node optimization like in Cycles.
A Bump node without a Height input is meaningless and does nothing.
As such, it is available as an old workaround that allows making Node
Group inputs that default to normal when not connected, by routing
via a no-op Bump node before doing math.

Cycles specifically recognizes this use case and either bypasses
the node, or converts it into a Geometry Normal node, but Eevee
was still evaluating it as usual. That incurred performance cost,
and also normalized the vector unlike Cycles.

This implements the same bypass logic for Eevee. Since I'm not
sure if it's possible to totally remove the node at this stage,
it emits a no-op function call to copy the input vector.

Differential Revision: https://developer.blender.org/D14045
2022-02-08 14:37:25 +03:00
3267c91b4d Fix T91253: Slow pose bone selection with many bones
Viewport cull bones during selection to avoid depth-picking
reading the depth buffer for bones that aren't in the viewport.

Files with thousands of bones could hang blender for seconds while
selecting. The issue could still happen with overlapping bones or when
zoomed out so all bones are under the cursor, however in practice this
rarely happens.

Now files with many bones select quickly.

Related changes include:

- Split `BKE_pchan_minmax` out of `BKE_pose_minmax`.
- Add `mat3_to_size_max_axis` to return the length of the largest
  axis (used for scaling the radius).

Reviewed By: sybren

Maniphest Tasks: T91253

Ref D13990
2022-02-08 22:16:51 +11:00
530be35516 Merge branch 'blender-v3.1-release' 2022-02-08 12:13:24 +01:00
de71860555 Fix T95570: missing task isolation when computing normals 2022-02-08 12:12:49 +01:00
923ccf6b10 LibOverride: Use new 'hierarchy root' info in relevant override code.
This new info simplifies greatly the handling of resync and deleting
liboverride hierarchies, and makes those operations more robust to
complex dependencies cases between different hierarchies.

Related to T95283.
2022-02-08 11:22:56 +01:00
98c242affd LibOverride: Add 'hierarchy root ID' info.
This change will make handling of liboverrides hierarchies (especially
resyncing) much easier and efficient. It should also make it more
resilient to 'degenerate' cases, and allow proper support of things like
parenting an override to another override of the same linked data (e.g.
a override character parented to another override of the same
character).

NOTE: this commit only implements minimal changes to add that data and
generate it for existing files on load. Actual refactor of resync code
to take advantage of this new info will happen separately.
2022-02-08 10:51:31 +01:00
32278b79a8 LibOverride: Add 'hierarchy root ID' info.
This change will make handling of liboverrides hierarchies (especially
resyncing) much easier and efficient. It should also make it more
resilient to 'degenerate' cases, and allow proper support of things like
parenting an override to another override of the same linked data (e.g.
a override character parented to another override of the same
character).

NOTE: this commit only implements minimal changes to add that data and
generate it for existing files on load. Actual refactor of resync code
to take advantage of this new info will happen separately.
2022-02-08 10:50:39 +01:00
0617efd51b Merge branch 'blender-v3.1-release' 2022-02-08 10:26:42 +01:00
1995aae6e3 Fix T94415: Nodes: poor selection behavior inside frame nodes
Previously, node selection made no distinction between a frame node and
other nodes. So a frame node would be selected by their whole rect or
center (depending on box/lasso/circle select). As a consequence of this,
box and lasso could not pratically be started inside a frame node (with
the intention to select a subset of contained child nodes) because the
frame would be selected immediately and tweak-transforming started.
Circle selecting would always contain the frame node as well (making
transforming a subset of nodes without also transforming the whole frame
impossible).

Now change selection behavior so that for all selection modes only the
border [the margin area that is automatically added around all nodes,
see note below] of a frame node is considered in selection. This makes
for a much more intuitive experience when arranging nodes inside frames.

note: to make the area of interest for selection/moving more obvious,
the cursor changes when hovering over (as is done for resizing).
note: this also makes the resize margin consistent with other nodes.
note: this also fixes right resize border (was exclusive instead of
inclusive as every other border)

Also fixes T46540.
2022-02-08 10:14:14 +01:00
67c12ed765 Cleanup: remove useless statement.
Layouts are active by default when created, no need to set this
explicitely. Leftover from proxy removal.
2022-02-08 09:16:49 +01:00
8abd8865d2 Mesh: add option to select vertices by similar vertex crease
This adds an option to the "Select Similar" operator in edit mode to
select vertices based on vertex crease similarity. The implementation
follows that of the edge crease, with a 1-dimensional KD-tree used to
store and retrieve vertex indices base on crease values.

To maintain compatibility with old files (scripts), the `SIMEDGE_CREASE`
enumeration identifier remains `CREASE`, while the one for the new
`SIMVERT_CREASE` is `VCREASE` to follow the naming convention of other
enum values.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D14037
2022-02-08 06:10:22 +01:00
Dominik Fill
7047bd41c6 UI: Change computation of node socket position to align with label
This Diff changes the computation of the input and output socket
position to being always aligned with its corresponding label.

Reviewed By: campbellbarton

Ref D14025
2022-02-08 14:55:02 +11:00
667b4bc0e4 Cleanup: clang-format 2022-02-08 14:25:31 +11:00
9d674d9852 Fix dna_genfile error converting signed int types to floating point
Regression in 51befa4108
caused negative values to overflow into a uint64_t.

Resolve by casting to a signed int from originally signed types.

This caused D14033 not to work properly.
2022-02-08 11:54:44 +11:00
7df651367f Cleanup: use an intermediate value for cast_primitive_type
Assign the actual value before casting to large uint64_t/double types.

This improves readability, especially in cases where both pointer
and integer casts were used in one expression, to make matters worse
clang-format treated these casts as a multiplication.

This also made debugging/printing the values more of a hassle.

No functional changes (GCC produced identical output).
2022-02-08 11:54:44 +11:00
e5fc579073 Merge branch 'blender-v3.1-release' 2022-02-07 18:42:58 -06:00
b76918717d Fix T95573: Incorrect bounding box of evaluated curve
Account for `CurveEval`, which stores the proper deformed and
procedurally created data, unlike the `nurb` list, which has always
just meant a copy of the original curve.

Also account for the case when the curve is empty by using a -1, 1,
fallback bounding box in that case, just like mesh objects.
2022-02-07 18:42:31 -06:00
770793e545 Merge branch 'blender-v3.1-release' 2022-02-07 16:11:21 -06:00
Wannes Malfait
229d0ace02 Fix T95532: Merge node deletes everything for empty selections
The problem was that nullptr was returned which is a valid value for
Mesh * and hence the returned optional was treated as having some value.
There was no check for point clouds so that was fixed as well.

Differential Revision: https://developer.blender.org/D14026
2022-02-07 16:08:36 -06:00
11d785edea Fix T95502: macOS app has both python 3.9 and 3.10 executables 2022-02-07 20:51:03 +01:00
674e4640f6 Merge branch 'blender-v3.1-release' 2022-02-07 14:29:26 -05:00
Myles Walcott
880e85fc80 Cleanup: Grammar in doc/python_api
* Its -> It's
* Scripts -> Script's
* then -> than

Several phrasing grammar fixes.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D14021
2022-02-07 14:28:12 -05:00
fe1816f67f Curves: Rename "Hair" types, variables, and functions to "Curves"
Based on discussions from T95355 and T94193, the plan is to use
the name "Curves" to describe the data-block container for multiple
curves. Eventually this will replace the existing "Curve" data-block.
However, it will be a while before the curve data-block can be replaced
so in order to distinguish the two curve types in the UI, "Hair Curves"
will be used, but eventually changed back to "Curves".

This patch renames "hair-related" files, functions, types, and variable
names to this convention. A deep rename is preferred to keep code
consistent and to avoid any "hair" terminology from leaking, since the
new data-block is meant for all curve types, not just hair use cases.

The downside of this naming is that the difference between "Curve"
and "Curves" has become important. That was considered during
design discussons and deemed acceptable, especially given the
non-permanent nature of the somewhat common conflict.

Some points of interest:
- All DNA compatibility is lost, just like rBf59767ff9729.
- I renamed `ID_HA` to `ID_CV` so there is no complete mismatch.
- `hair_curves` is used where necessary to distinguish from the
  existing "curves" plural.
- I didn't rename any of the cycles/rendering code function names,
  since that is also used by the old hair particle system.

Differential Revision: https://developer.blender.org/D14007
2022-02-07 11:56:48 -06:00
b8c764c5d1 Merge branch 'blender-v3.1-release' 2022-02-07 18:45:24 +01:00
65d287a14a Fix T95543: incorrect handling of implicit field inputs in ui 2022-02-07 18:44:30 +01:00
d3e9d74a5f Merge branch 'blender-v3.1-release' 2022-02-07 18:17:29 +01:00
eb071e3d3c Fix: missing null check
This fixes https://github.com/JacquesLucke/animation_nodes/issues/1827.
2022-02-07 18:16:35 +01:00
2f7aecb6ce Merge branch 'blender-v3.1-release' 2022-02-07 17:57:01 +01:00
2f868e5647 Fix T95578: missing update when linking selected nodes
This removes a "narrow" update in `snode_autoconnect` in favor
of the more general update in `node_make_link_exec`.
2022-02-07 17:56:25 +01:00
Charlie Jolly
fe4e85a924 Nodes: Dynamic node class for Map Range node
This patch makes it possible to set the UI color of a node's
header bar and override the default from the node's typeinfo.

Currently the color is taken from the `.nclass`
member of the node's bNodeType->TypeInfo struct.
This is created once when registering the node.
The TypeInfo is used for both UI and non-UI functionality.
Since the TypeInfo is shared, the header bar for the node
can't be changed without changing all nodes of that type.

The Map Range node is shown as a `Converter` or blue color by default.
This patch allows this to be changed dynamically to `Vector` or purple.

This is done by adding a `ui_class` callback to node typeinfo struct.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D13936
2022-02-07 15:39:39 +00:00
a7b5982030 Fix missing removal of proxy references in py scripts.
Reported by studio (Hjalti), thanks.
2022-02-07 16:23:26 +01:00
Shrey Aggarwal
a5dd1bc53d Fix T90868: Console window flash when exiting
If the console was hidden on windows, it would
be made visible during shutdown in an effort
not hide a potentially active interactive console
session. This however did not take in account
if blender was actually launched from an interactive
console causing the console window to briefly flash
during shutdown even when launched from the new
launcher, the brief flash concerned some users.

This change adjusts the behaviour to restore the
console only when blender was started from the
console.

Reviewed By: LazyDodo
Differential Revision: https://developer.blender.org/D14016
2022-02-07 08:20:12 -07:00
a5cddaefd3 Merge branch 'patch/gpencil-undo-system' into greasepencil-object 2022-02-07 14:30:20 +01:00
1d2bd57ff7 Merge with patch/gpencil-update-cache 2022-02-07 14:30:01 +01:00
b3bb51dd83 Fix asset-view template ignoring "Asset Indexing" debug option
If the "Asset Indexing" option was disabled in Preferences > Experimental
> Debugging, the asset-view template (used by pose libraries for
example) would still use the indexing.
2022-02-07 12:18:15 +01:00
c3ac35d6e7 Merge branch 'patch/gpencil-update-on-write' into patch/gpencil-undo-system 2022-02-07 12:13:22 +01:00
463828a7a8 Merge branch 'master' into patch/gpencil-update-on-write 2022-02-07 12:12:05 +01:00
d9b1bd01f7 Merge branch 'blender-v3.1-release' 2022-02-07 11:13:06 +01:00
3cd686cae8 Fix UI messages (typos etc.). 2022-02-07 11:12:37 +01:00
ecc09116b8 Remove tagging copy-on-write tag on gpd id
Co-authored-by: @yann-lty
2022-02-07 10:43:26 +01:00
Dimitry Kaplin
1c5f2e49b7 VSE: Add filter method to strip transform
Previously, nearest interpolation filter was used for preview, because
it offered good performance and bilinear was used for rendering. This
is not always desirable behavior, so filter method can now be chosen by
user. Chosen method will be used for preview and for rendering.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D12807
2022-02-07 10:41:26 +01:00
6766699530 UV: use grey on black for dashed-line display
Dashed line display was changed since 2.7x, using white on black
instead of grey on black.

This made selection difficult to see as white is brighter
than the default selected color.

Match the grey used in 2.7x.
2022-02-07 15:50:42 +11:00
2b14aa0a39 Cleanup: spelling in comments 2022-02-07 15:33:10 +11:00
7e6066c9c3 Cleanup: clang-format 2022-02-07 15:32:34 +11:00
Henrik Dick
94866ef84f Fix Bevel intersection continuity.
This patch from Henrik Dick improves the continuity between the
grid forming corners and the edge polyons on multisegment bevels.
For details, see patch D13867.
2022-02-06 16:01:57 -05:00
f199f03994 Merge branch 'blender-v3.1-release' 2022-02-06 15:00:21 -05:00
Aras Pranckevicius
1d59a7aa77 Fix T95384: new obj exporter inaccurate roughness value in new exporter.
Fixes T95384. New exporter was missing a fix for T94516 that recently got applied to the python exporter.

Also changed the obj export tests code so that when save_failing_test_output is requested and MTL result is different from the golden expectation, it is saved as well, similar to how it's done for the OBJ file result.
2022-02-06 14:53:07 -05:00
Aras Pranckevicius
9261bc9476 Further speedup of new obj exporter.
This change from Aras further parallelizes wihin large meshes (the previous one
just parallelized over objects).

Some stats: on A Windows machine, AMD Ryzen (32 threads):

(one mesh) Monkey subdivided to level 6: 4.9s -> 1.2s (blender 3.1 was 6.3s; 3.0 was 49.4s).
(one mesh) "Rungholt" minecraft level: 8.5s -> 2.9s (3.1 was 10.5s; 3.0 was 73.7s).
(lots of meshes) Blender 3 splash: 6.2s -> 5.2s (3.1 was 48.9s; 3.0 was 392.3s).

On a Linux machine (Threadripper, 48 threads, writing to SSD):
Monkey - 5.08s -> 1.18s (4.2x speedup)
Rungholt - 9.52s -> 3.22s (2.95x speedup)
Blender 3 splash - 5.91s -> 4.61s (1.28x speedup)

For details see patch D14028.
2022-02-06 14:28:22 -05:00
96cda4da28 GLDebug: Wrap glDispatch function into our debug wrappers 2022-02-06 17:03:05 +01:00
e440691e89 Merge branch 'blender-v3.1-release' 2022-02-06 12:39:56 +01:00
8be20fcc61 GPU: Fix assert when running without --debug-gpu option on older GL
This was caused by rB3a90f93507a344d2b6eb3ae631371348ff977047
2022-02-06 12:39:17 +01:00
48fbf0baea DRW: Add preprocessor error if including common_view_lib.glsl without draw_view
This avoid making include mistake and potentially detect areas that do
not really need common_view_lib.glsl.
2022-02-06 01:25:46 +01:00
085a3662dd GPUShaderCreateInfo: Add duplication error checking of dependency merging
As of now we do not allow additional infos duplication. We could in the future
but for now assert that this is not the case.
2022-02-06 01:25:46 +01:00
153f2c20b2 Merge branch 'blender-v3.1-release' 2022-02-05 17:52:31 -06:00
59a8bdd48c Fix: Displaying any point cloud in the viewport causes crash
Caused by rBf75449b5f2b04b79, which was missing a null check when
attempting to extract a `CustomData` pointer from an mesh that might
be null if the object isn't a mesh object. The commit added null checks
elsewhere, so simply adding them here is a straightforward fix.

Fixes T95526, T95539
2022-02-05 17:52:04 -06:00
94c0a59f95 Merge branch 'blender-v3.1-release'
Also fixed conflicts due to the change in file writing in the new obj exporter
in master, and fixed one of the tests that was added in master but not 3.1.
2022-02-05 18:04:30 -05:00
Aras Pranckevicius
c24b2cdebf Fix T95360, new 3.1 obj exporter losing nurbs curve "endpoint".
The new wavefront .obj exporter in 3.1 was producing slightly invalid parm line syntax (missing u), and was not setting first/last N params to zeroes and ones for curves with "endpoint" flag properly.
2022-02-05 17:51:03 -05:00
bfe6e792c7 Merge branch 'blender-v3.1-release' 2022-02-05 23:09:09 +01:00
3a90f93507 GPU: Debug: Avoid double printing of compilation issues
To avoid that, we simply filter using a debug group.
2022-02-05 23:08:49 +01:00
26b70fce8a GPU: move gpu_shader_shared_utils.h to the public section of the module
This is then easier to include in other modules.
2022-02-05 22:42:34 +01:00
2ee81bf285 Merge branch 'blender-v3.1-release' 2022-02-05 22:18:51 +01:00
f2087dfc69 GPUTexture: Fix missing/wrong cases in to_data_format() 2022-02-05 19:29:45 +01:00
edc0e77afe GPU: Enable CLOG for gpu when --debug-gpu option is set
This is because all of the debug printing is done through CLog now. Without
it the is little point in this option.
2022-02-05 19:27:21 +01:00
7bdfce687b GL: Fix compute shader label error 2022-02-05 19:27:09 +01:00
cbd23a7304 DRW: Fix memory leak in UniformArrayBuffer 2022-02-05 13:59:46 +01:00
e5af6a0d0f GLShaderInterface: Fix SSBO using the ubo mask
This might head lead to a crash when a shader uses both ubo and ssbo.
2022-02-05 13:28:41 +01:00
835dd95046 BLF: Cleanup blf_glyph_cache_find & blf_font_size
Removes unnecessary calls to blf_glyph_cache_find, simplifies
blf_font_size, and reduces calls to it. blf_glyph_cache_new
and blf_glyph_cache_find made static.

See D13374 for more details.

Differential Revision: https://developer.blender.org/D13374

Reviewed by Campbell Barton
2022-02-04 18:32:32 -08:00
b1cee36190 BLF: Default Size as Float
Allowing setting and storing of the default font size as float.

See D13230 for more details.

Differential Revision: https://developer.blender.org/D13230

Reviewed by Campbell Barton
2022-02-04 18:05:25 -08:00
141da5dc03 Partially pevert "Fix error in b1b1a74af15b4eaa0757ad88acfbcac73b9a64fe"
This partially reverts commit 81d2eda2bf.

That commit introduced unrelated changes.
2022-02-04 23:00:43 -03:00
fbd5b85456 BLF: Removal of blf_font_draw_ascii Declaration
Removal of declaration of unused blf_font_draw_ascii

See D13624 for more details.

Differential Revision: https://developer.blender.org/D13624

Reviewed by Campbell Barton
2022-02-04 17:55:50 -08:00
bb3bcf744c BLF: Save fixed_width value in cache
Cache the font size's ideal fixed width column size in the glyph cache
rather than the font itself to improve performance.

See D13226 for more details.

Differential Revision: https://developer.blender.org/D13226

Reviewed by Campbell Barton
2022-02-04 17:49:21 -08:00
2a967d444f BLF: blf_glyph_cache_free Made Static
blf_glyph_cache_free does not need to be public.

See D13395 for more details.

Differential Revision: https://developer.blender.org/D13395

Reviewed by Campbell Barton
2022-02-04 17:37:23 -08:00
81d2eda2bf Fix error in b1b1a74af1
`op` --> `op->customdata`
2022-02-04 22:12:07 -03:00
b1b1a74af1 Cleanup: set 'op->customdata' out of 'viewops_data_create'
Setting the `op->customdata` out of `viewops_data_create` makes the usage of the function clearer thus making the code easier to read.
2022-02-04 20:38:53 -03:00
ec9f237a9e Cleanup: merge functions with similar usage
`viewops_data_alloc` allocates and stores some pointers in
`ViewOpsData` while `viewops_data_create` reuses already stored
pointers and also stores others in `ViewOpsData`.

The similar names and usages can confuse and in this case it also
creates a dependency on the order in which these functions are called.

Merging these functions simplifies usage and deduplicates code.
2022-02-04 20:16:36 -03:00
f79c8e25f1 Cleanup: Grammar in comments and tooltips
- "own" -> "its own"
- "it's" -> "its"
- Use proper plural
2022-02-04 14:52:52 -06:00
0b4cf2984f Fix: Remove incorrect assert in mesh modifier evaluation
Since we have a node that sets a mesh's auto smooth angle
(unfortunately, in retrospect), we generally can't assume at all
that value is the same as whatever input mesh. Similar asserts
were removed previously in 8216b759e9. While the attempt
at assertions to clarify assumptions is noble, this one doesn't
make sense anymore.

I found this while investigating T95479.

Differential Revision: https://developer.blender.org/D14009
2022-02-04 14:19:04 -06:00
a5be935966 Fix uninitialized value in Cycles BVH after recent changes
Found by asan, unknown if it actually caused an issue.
2022-02-04 20:27:49 +01:00
dc85776b8b GLShader: Fix several low importance issues
- Fix image.format conversion to string
- Fix warnings about ARB_conservative_depth not found even if GL > 4.2
- Add `array(type)` define for portable array definition
2022-02-04 20:21:41 +01:00
c017820692 GPUShader: Improve error/warning logging experience
Thanks to the new `ShaderCreateInfo` we now include source files without
any modification. This let us query which are the source files passed to the
`print_log` function. The log will now include a file with row and column
number which is interpreted as a link in most IDE.

DEBUG_CONTEXT_LINES will add more lines around the error lines for more
context. This is also useful if the error line is imprecise (because of
driver bugs) and the reported line is not sufficient to know the location
of the error.

The DEBUG_DEPENDENCIES option will display the list of included files in
the shader sources. Note that it will not print generated source.

This commit also fixes some issues with unhelpful logs, bogus row & column
numbers, other error format, and bug if row was 0.
2022-02-04 20:21:41 +01:00
671fb286ab GPUShader: Cleanup dependency system to not remove string allocation
Source files are now only referenced and listed for the driver to ingest.
Shader sources now includes generated data if any.
Also cleans up gpu_shader_dependency_get_builtins casts.
2022-02-04 20:21:41 +01:00
ae50527c23 GL: Add all image types in binding setup. 2022-02-04 20:21:41 +01:00
25c50ddd09 GPUFramebuffer: Bump max attachment count to 8
This is needed by eevee-rewrite
2022-02-04 20:21:41 +01:00
77d005ea36 GPUShaderCreateInfo: Merge changes from eevee-rewrite
This includes multiple commits:
- Fix crash when using std::cerr for error output
- Add auto_resource_location which overrides all resources location (not vert input)
- Improve codestyle of error reporting.
- Add type conversion to string and to `eGPUType`
- Add comparison operator (will be used for hash collision resolution).
- Add members related to generated code (codegen)
2022-02-04 20:21:41 +01:00
03fbb3de24 GPUState: Add more barrier types
This will be useful when compute shader will be used more.

Refer to the opengl documentation for their meaning.
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glMemoryBarrier.xhtml
2022-02-04 20:21:41 +01:00
66e9ee1a2f Cleanup: Remove unused "init" node tree flag
The value of this flag was set, but not used anywhere.

Differential Revision: https://developer.blender.org/D13519
2022-02-04 12:51:03 -06:00
afc2cc393d Merge branch 'blender-v3.1-release' 2022-02-04 19:35:35 +01:00
260e6fd46b Workbench: Fix unreported heavily quantized mesh due to driver issue
Detected on `amdgpu-pro` libGL implementation. The workaround is to not
use explicit location for vertex attributes. This is not a real problem
as we don't rely on them for now.
2022-02-04 19:34:48 +01:00
0446c9c875 Fix: Incorrect default distance for merge by distance node
This was an oversight in the patch that added this node,
the default merge distance is meant to be the same as the weld
modifier, 0.001m, meaning by in most situations it removes
vertices generally at the same location.
2022-02-04 12:21:27 -06:00
b61cb67e6d Fix T94410: stopping Cycles render in 3D viewport quad view keeps using CPU
Only one of the four renders was being stopped.
2022-02-04 18:55:07 +01:00
a5e9f9b346 DRW: Fix a comment 2022-02-04 18:54:32 +01:00
4a1979b55d Cleanup: Overlay: Remove uneeded UBO binds 2022-02-04 18:54:32 +01:00
7b88a206b2 DRW: Add DRW_UNUSED_RESOURCE_TRACKING for ubo and ssbo
When uncommented, this option will make any call binding a resource that is
not present in the shader produce a warning message with its origin.
2022-02-04 18:54:32 +01:00
9aa25ff53d DRW: Add compute_ref calls, barriers calls, and vertex_buffer_ref
- Compute ref let the size of dispatch be modified just before drawing.
- Barrier call makes it possible to chain multiple compute passes in one pass.
- DRW_shgroup_vertex_buffer_ref is the analog of DRW_shgroup_uniform_block_ref.
2022-02-04 18:54:32 +01:00
665997f1cd DRW: Fix bug in cubemap creation in draw::Texture
The order of if clause made impossible to create a cubemap.
2022-02-04 18:54:32 +01:00
a598615182 Merge branch 'patch/gpencil-update-on-write' into patch/gpencil-undo-system 2022-02-04 18:23:15 +01:00
edb0e7ca30 Fix T95471: baking normals wrong after recent MVert normals refactor 2022-02-04 18:15:39 +01:00
bb308d9762 Ensure update-on-write only in active depsgraph
Co-authored-by: @yann-lty
2022-02-04 18:11:14 +01:00
0f40855a09 Fix T93851: Cycles wrong glossy indirect pass with volumes 2022-02-04 17:53:39 +01:00
b2f5540a02 Fix: Remove incorrect assert in mesh modifier evaluation
Since we have a node that sets a mesh's auto smooth angle
(unfortunately, in retrospect), we generally can't assume at all
that value is the same as whatever input mesh. Similar asserts
were removed previously in 8216b759e9. While the attempt
at assertions to clarify assumptions is noble, this one doesn't
make sense anymore.

I found this while investigating T95479.

Differential Revision: https://developer.blender.org/D14009
2022-02-04 10:32:21 -06:00
e7912dfa19 Attributes: Infrastructure for generic 8-bit integer data type
This commit adds infrastructure for 8 bit signed integer attributes.
This can be useful given the discussion in T94193, where we want to
store spline type, Bezier handle type, and other small enums as
attributes.

This is only exposed in the interface in the attribute lists, so it
shouldn't be an option in geometry nodes, at least for now.
I expect that this type won't be used directly very often, it
should mostly be cast to an enum type. However, with support
for 8 bit integers, it also makes sense to add things like mixing
implementations for consistency.

Differential Revision: https://developer.blender.org/D13721
2022-02-04 10:29:11 -06:00
b2e43a4a9d deps_builder: Update to freetype 2.11.1
Required to solve a crash on windows (T95367)

Mostly an uneventful update, except for FreeType
giving its cmake options a rename.

Reviewed By: brecht, sybren
Differential Revision: https://developer.blender.org/D13968
2022-02-04 09:19:10 -07:00
b4563ab2df Cleanup: avoid generating some functions in all translation units
Every translation unit that included the modified headers generated
some extra code, even though it was not used. This adds unnecessary
compile time overhead and is annoying when investigating the
generated assembly.
2022-02-04 17:18:56 +01:00
4aeb6add6e Guarded allocator: Document non-obvious initialization with MEM_new()
Initialization with `MEM_new()` depends a lot on the initialization rules
of C++, which are not obvious. Calling it with no arguments to be passed
to the constructor may cause the resulting object to be implicitly 0
initialized (or parts of it). This can have an impact on performance
sensitive code, so it's something to document.

Alternatively we could enforce default initialization (as opposed to the
value initalization that happens now), but this could cause
uninitialized memory in a way that isn't obvious either. This is a
possible source of bugs, so Jacques and I decided against it.
2022-02-04 16:57:46 +01:00
RedMser
150f42e6d3 NLA: shortcut to rename active strip
Use the global F2 rename panel for the NLA editor to rename NLA strips.

Reviewed By: sybren, RiggingDojo

Differential Revision: https://developer.blender.org/D12300
2022-02-04 16:39:00 +01:00
7331c86dbf macOS: support building blender-thumbnailer
It was missing framework flags added in `setup_platform_linker_flags`.
Keep it off until QuickLook Thumbnailing is implemented.

Differential Revision: https://developer.blender.org/D13997
2022-02-04 20:57:30 +05:30
295bf80daa Merge branch 'patch/gpencil-update-on-write' into patch/gpencil-undo-system 2022-02-04 15:56:05 +01:00
b2abcea950 Merge branch 'blender-v3.1-release' 2022-02-04 15:54:37 +01:00
f75449b5f2 Fix T95467: Textures disappear when going to Edit Mesh on Solid Texture mode
The check for existence of custom data layers did not take wrapper nature of
mesh into account.

Quickest and safest for 3.1 solution is to take care of branching of checks
in the draw manager.

Ideally both wrapper and mesh access will happen via the same public API
without branching in the "user" code. That is something outside of the fix
for the coming release though.

Differential Revision: https://developer.blender.org/D14013
2022-02-04 15:54:25 +01:00
d3b5fa502e Merge branch 'master' into patch/gpencil-update-on-write 2022-02-04 15:48:18 +01:00
7b3b452f82 Add optimization to skip decoding uneccessary steps
Co-authored-by: @yann-lty
2022-02-04 15:41:43 +01:00
3990a9632f Correctly encode the first full copy in the chain
Co-authored-by: @yann-lty
2022-02-04 15:40:48 +01:00
7b686970ef Merge branch 'blender-v3.1-release'
# Conflicts:
#	source/blender/draw/engines/workbench/workbench_effect_cavity.c
2022-02-04 15:40:29 +01:00
0b0f4829e1 Cleanup: Removed Object type specific 'make_local' callback.
This callback was only needed to allow specific handling of proxies, now
that theses have been removed the generic
`BKE_lib_id_make_local_generic` code works for objects as well.
2022-02-04 15:35:51 +01:00
26992d9675 Refactor print update cache function.
Co-authored-by: @yann-lty
2022-02-04 15:33:35 +01:00
2e766ff762 Image Editor: Fix slowdown with 8b colormanaged images.
Byte images are converted to float. Due to an issue how VSE cache is
freeing its images we cannot store these float buffers what leads
to recalculating it for each change in the image editor.

This fix will reduce the slowdown to areas that have the root cause of
the memory leak, so the buffers can be reused between refreshes.

NOTE: The root cause should still be fixed.

Thanks for reporting Sybren!
2022-02-04 15:32:28 +01:00
4eb10e414b Fix wrong use of region size without pixel-size applied
Didn't cause visible issues, because the layout uses spacers to
right-align text, which happens to use the region size with pixel-size
applied for calculations.
2022-02-04 15:29:52 +01:00
3d973d01fa View3D: move some of the early returns from operators to the poll function
Some navigation operators check flags like `RV3D_LOCK_ROTATION` in the
invoke function to see if the operation can be performed.

As the comment indicates, these checks should be in the poll function.

This avoids redundant initialization.

Note that this brings functional changes as now operators with context
`EXEC_DEFAULT`  will also be affected by the flag.
(There doesn't seem to be a problem with the current code).

Differential Revision: https://developer.blender.org/D14005
2022-02-04 11:21:20 -03:00
7099d5b661 Fix: Missing translations from operator descriptions
The strings in the `get_description` functions for operators need
translation, they are not found by the translation system automatically,
and there is no translation applied afterwards either (as far as I could
tell). Some used `N_` before, but most did nothing.

Differential Revision: https://developer.blender.org/D14011
2022-02-04 07:31:53 -06:00
623ff64a27 Fix T81541: Symmetrize Transform Constraint, Y rotational axis unexpected results
The case where Y rotation is mapped to Y rotation was not handled.
This is now fixed.

Also added an automated test to make sure that the symmetrize operator
functions as intended.

Reviewed By: Sybren

Differential Revision: http://developer.blender.org/D9214
2022-02-04 14:21:20 +01:00
0dd3e77d71 Cleanup: Workbench: Remove unused resources in cavity shaders
This avoid uneeded resource binds.
2022-02-04 14:08:27 +01:00
71fff31990 Fix T95427: Crash during dragging a link in a node editor
This was caused by macros interpreted as recursive. Workaround by
not using macros at all and just define local variables which
hopefully will be optimized.
2022-02-04 14:08:27 +01:00
e7b8871d3d Fix T95284 Workbench: "World" Cavity Type Doesn't Render Anything
This was caused by a faulty UBO bind (not updated after renaming).
2022-02-04 14:08:27 +01:00
3adcfbf63c Merge branch 'blender-v3.1-release' 2022-02-04 14:07:06 +01:00
080dd18cdf Fix T95427: Crash during dragging a link in a node editor
This was caused by macros interpreted as recursive. Workaround by
not using macros at all and just define local variables which
hopefully will be optimized.
2022-02-04 14:05:17 +01:00
8e0763827e Fix T95284 Workbench: "World" Cavity Type Doesn't Render Anything
This was caused by a faulty UBO bind (not updated after renaming).
2022-02-04 14:05:17 +01:00
cb986446e2 Fix Crash: Switching to wireframe mode.
Crash introduced by {rB0cb5eae}.

When switching to between drawing modes the region.draw_buffer could be
uninitialized when the gizmo depth test is performed. When the mouse is
placed on top of a gizmo part that could be highlighted would crash.

This fix adds a early exit when depth testing is requested, but there
isn't a draw_buffer. Not sure this is an root cause fix.

Reported by multiple animators in Blender Studio.
2022-02-04 14:00:06 +01:00
f9aab6717b Merge branch 'blender-v3.1-release' 2022-02-04 13:11:18 +01:00
b8a634cb1d Fix T95489: support writing to vertex groups with geometry nodes again
Technically, this can't be relied upon in the long term. It worked more or
less accidentally before. It was broken by a previous fix accidentally. I mainly
bring it back because rBa985f558a6eb16cd6f0 was not expected to have
this side effect.

Note, this change can result in slower performance. Writing to a vertex
groups is less efficient than using a generic attribute.
2022-02-04 13:10:02 +01:00
9c48b41cfc Renamings and more code documentation
Co-authored-by: @yann-lty
2022-02-04 12:26:01 +01:00
e6f9a72884 Cleanup: remove unused LOG declaration
No functional changes.
2022-02-04 11:26:06 +01:00
Aras Pranckevicius
a20cfb9eff BLI: use methods specialized for finding a single char in StringRef
Previously, these methods used the more generic substring-finding
algorithm, which is more complex and slower.

Using the more specialized methods results in a noticable speedup
in the obj importer (D13958).

Differential Revision: https://developer.blender.org/D14012
2022-02-04 10:38:05 +01:00
5088d907e5 Compositor: Backdrop mode changes node grid.
When viewing backdrop on top of the node grid, the grid would be
rendered black when the mode wasn't set to RGBA. This fix fixes this by
reverting the previous fix of drawing the backdrop and implement a
different one that recomputes the UV coordinates on the screen edges.
2022-02-04 09:51:25 +01:00
2d429bfdf8 Fix T93425: makesdna crashes during build with LTO on s390x Linux
DNAstr was assumed to be 4-byte aligned which is not necessarily
the case for byte-arrays.

Use a compiler attribute to ensure this is the case.

Thanks to @mtasaka for investigating and providing a patch.
2022-02-04 19:48:00 +11:00
Bastien Montagne
e9fc25835f Remove internal proxy code, and deprecate related DNA data.
Part of T91671.

Not much else to say, this is mainly a massive deletion of code.

Note that a few cleanups possible after this proxy removal were kept out
of this commit to try to reduce a bit its size.

Reviewed By: sergey, brecht

Maniphest Tasks: T91671

Differential Revision: https://developer.blender.org/D13995
2022-02-04 09:30:44 +01:00
5a4eadc2e7 Cleanup: spelling in comments
Also update viewport comments.
2022-02-04 16:07:24 +11:00
39a1b51efd Cleanup: cage3d gizmo used two margin scale values
Replace this with a single margin.
2022-02-04 15:41:31 +11:00
ef951825a5 Merge branch 'blender-v3.1-release' 2022-02-04 15:38:30 +11:00
lictex_
f7a6e8db04 Fix T88579: scale cage doesn't work well for small/large objects
Apply proper view scale for cage 3d's draw_select,
same as draw.

Reviewed By: campbellbarton

Ref D13956
2022-02-04 15:37:07 +11:00
7803312476 Cleanup: halve calls to BLI_str_utf8_size_safe in the text editor
Syntax highlighted text was calculating the utf8 character
size twice per character.
2022-02-04 14:02:53 +11:00
d730f79e0e Cleanup: use mono-space font drawing for single character display
This doesn't make a user visible difference since it's only used for
brackets at the moment, this is more for general correctness as the
width calculation for mono-spaced text drawing is different
(as it uses BLI_wcwidth).
2022-02-04 14:02:53 +11:00
28656293c6 Cleanup: Clang tidy, use braces
Braces missed in b73d3b80fd
2022-02-03 18:27:42 -06:00
3ddc39bec9 Merge branch 'blender-v3.1-release' 2022-02-04 11:17:49 +11:00
ef2685afea Fix assertion snapping to selected in mesh edit-mode
ED_transverts_create_from_obedit expected an evaluated object.

Add flag to request TX_VERT_USE_MAPLOC to be set, which avoids having to
calculate this data when it's not used as well as the requirement
that the input object be evaluated from the depsgraph.
2022-02-04 11:08:34 +11:00
b73d3b80fd Fix T94334: Area close operator crash in 3D view menu
This fixes the crash by removing the `do_view3d_header_buttons` handler.
The code can work at a higher level here, using the operator for setting
the select mode, which makes this patch a cleanup as well.

The operator now has a description callback to add the custom
description used for the behavior in its invoke method.

Differential Revision: https://developer.blender.org/D13660
2022-02-03 17:36:05 -06:00
af426c8508 Cleanup: Add file names back to node header
These were removed in rBbe3f3812dc4b, but it's preferred to keep them.
I had to do a bit of reorganizing, and I corrected the file type too.
2022-02-03 15:34:01 -06:00
3e0ffe5a39 Cleanup: Add comment about unsed custom data type
Since f59767ff97, these hair layer types are unused. Since DNA
compatibility was broken with any files that would contain them, the
indices can be reused to avoid growing custom data's typemap.
2022-02-03 14:35:51 -06:00
c832f4f7d1 Merge branch 'blender-v3.1-release' 2022-02-03 15:22:27 -05:00
a0c1306e8c Py Docs: Fix error is version switch
Slile parameter of 4 was looking for the language in the URL but the API docs do not have a language in the URL.
2022-02-03 15:21:44 -05:00
fd66733ca7 Merge branch 'blender-v3.1-release' 2022-02-03 15:06:31 -05:00
bda210d74a Py Docs: Fix json URL
In the future when we have a docs staging area it will be
important to change where this JSON is pulled from.
For now, always pull from the "Production" versions
2022-02-03 15:06:11 -05:00
56e5b4cc27 Merge branch 'blender-v3.1-release' 2022-02-03 14:38:26 -05:00
e7f74a7d6a Py Docs: Fix typo in previous commit
- Correct spacing
- Add missing comma
2022-02-03 14:37:55 -05:00
c4ffc3355f Merge branch 'blender-v3.1-release' 2022-02-03 14:25:57 -05:00
6a2fc3230f Py Docs: Implement version switch to switch between versions on the website
This commit adds a version switch similar to the one on the user manual,
in the future it would be nice to refactor both of these into a more generic
code that works for both. Maybe develop this into a sphinx extension.

As part of this change I had to change how the blender hash is displayed.
Instead of the version hash in the top left it has been moved to the page footer.

This change will also be backported to 2.93 LTS, 2.93 LTS, and 3.0.
2022-02-03 14:25:26 -05:00
0a2de0982e Small cleanup 2022-02-03 19:08:27 +01:00
2dcd02fcc2 Enable undo copy fallback if cache is empty
We cannot have "gaps" in our undo chain, things will quickly fall apart.
2022-02-03 19:08:03 +01:00
89e49f8f4a Fix crashes when chaining decode steps 2022-02-03 19:03:10 +01:00
c8dee942be Merge branch 'blender-v3.1-release' 2022-02-03 17:51:56 +01:00
f59767ff97 Curves: Changes to the new curves data-block
This patch refactors the "Hair" data-block, which will soon be renamed
to "Curves". The larger change is switching from an array of `HairCurve`
to find indices in the points array to simply storing an array of offsets.
Using a single integer instead of two halves the amount of memory for that
particular array.

Besides that, there are some other changes in this patch:
- Split the data-structure to a separate `CurveGeometry`
  DNA struct so it is usable for grease pencil too.
- Update naming to be more aligned with newer code and the style guide.
- Add direct access to some arrays in RNA
-- Radius is now retrieved as a regular attribute in Cycles.
-- `HairPoint` has been renamed to `CurvePoint`
-- `HairCurve` has been renamed to `CurveSlice`
- Add comments to the struct in DNA.

The next steps are renaming `Hair` -> `Curves`, and adding support
for other curve types: Bezier, Poly, and NURBS.

Ref T95355

Differential Revision: https://developer.blender.org/D13987
2022-02-03 10:49:51 -06:00
2f591adc1a Fix T95334: Crash with no vertex normals in multires bake
This is partially caused by a stupid mistake in cfa53e0fbe
where I missed initializing the `vert_normals` pointer in
`MResolvePixelData`. It's also caused by questionable assumptions
from DerivedMesh code that vertex normals would be valid.

The fix used here is to create a temporary mesh with the data necessary
to compute vertex normals, and ensure them here. This is used because
normal calculation is only implemented for `Mesh` and edit mesh, not
`DerivedMesh`. While this might not be great for performance, it's
potentially aligned with future refactoring of this code to remove
`DerivedMesh` completely. Since this is one of the last places the data
structure is used, that would be a great improvement.

Differential Revision: https://developer.blender.org/D13960
2022-02-03 10:35:50 -06:00
71cd9f9fbb Fix (unreported) broken logic in proxy to liboverride conversion.
Iterating over scene's objects while we modify those (through proxy to
override conversion code) is call for problems (use after free etc.).

Instead, all proxy objects need to be gathered first in a temporary
list, and processed all at once in a second loop.
2022-02-03 17:19:04 +01:00
7476eb761b Merge branch 'blender-v3.1-release' 2022-02-03 16:59:26 +01:00
4be87e97f4 Fix T94435: remove anonymous attributes when applying modifier
Differential Revision: https://developer.blender.org/D13994
2022-02-03 16:52:16 +01:00
c4f99aab6a Rename flag 2022-02-03 16:21:38 +01:00
c1edd7f0cb Use is_final in step_decode for tagging 2022-02-03 16:20:41 +01:00
c69497905b Fix double free in cache_node_update 2022-02-03 16:18:26 +01:00
b20160a0ba Tag gpd light update on mode change 2022-02-03 16:17:36 +01:00
bcded0a158 Merge branch 'blender-v3.1-release' 2022-02-03 15:38:51 +01:00
946c70e6a7 Fix (unreported) broken do_version of hidden layers from pre-2.8 files.
`BKE_collection_object_add` ensures given object is added to an editable
collection, and not e.g. a linked or override one.

However, some processes like do_version manipulate collections also from
libraries, i.e. linked collections, in those cases we need a version of
the code that unconditionnally adds the given object to the given
colleciton.
2022-02-03 15:37:05 +01:00
3bcbbf8992 Split Python OBJ importer and exporter, enabling only the importer.
This is from patch D13988. It removes the "- New" from the menu of the
new obj exporter, changes the default addon to just io_import_obj,
and does the right versioning thing.
Also disables the python tests for the old python exporter.
2022-02-03 09:30:55 -05:00
5920de9247 Merge branch 'blender-v3.1-release' 2022-02-03 14:54:39 +01:00
e4c179f1d8 Cleanup: clang-format 2022-02-03 14:54:03 +01:00
Sebastian Herholz
01f1b51a2e Fix T93565: revert Cycles to old normal behavior for point lights
This patch reverts the normal behavior of the spotlights. In the last fix,
the returned normal of a spot light was equal to its direction. This broke
some texturing methods used by artists.

Differential Revision: https://developer.blender.org/D13991
2022-02-03 14:50:06 +01:00
b4e06bd7d4 Cleanup: Rename 'TRACKBALLSIZE' to 'V3D_OP_TRACKBALLSIZE' 2022-02-03 10:06:09 -03:00
Germano Cavalcante
1963ad52ce Cleanup: Split View3D navigation code into specific compilation units
The view3d_edit.c file is already getting big (5436 lines) and mixes
operators of different uses.

Splitting the code makes it easier to read and simplifies the
implementation of new features.

Differential Revision: https://developer.blender.org/D13976
2022-02-03 10:06:09 -03:00
e5a110719f Fix T91254: Some editing operation indirectly delete objects from override collections.
Those cases are fairly hard to track down... Added some more checks,
also at lower levels, more generic levels of object editing, and fixed
core check in liboverride (previously code was assuming that an override
of a collection only could have overrides of objects or linked objects,
but this is not necessarily true).
2022-02-03 14:00:12 +01:00
ff9dc1986e Split Python OBJ importer and exporter, enabling only the importer.
This is from patch D13988. It removes the "- New" from the menu of the
new obj exporter, changes the default addon to just io_import_obj,
and does the right versioning thing.
Also disables the python tests for the old python exporter.
2022-02-03 07:56:55 -05:00
3bf2a6e3c9 Cleanup: use NULL items for the default sample enum
Using this enum quiets a warning when exporting key-maps.
2022-02-03 23:02:00 +11:00
60a09bc1be Merge branch 'blender-v3.1-release' 2022-02-03 22:59:09 +11:00
6c6556c5bd Docs: correct weight paint sample description 2022-02-03 22:57:24 +11:00
5a2101f754 Merge branch 'blender-v3.1-release' 2022-02-03 22:42:48 +11:00
59b777eedd Fix T95137: Spline calc_length not working with just 1 NURB point
The NURB case did not properly handle a curve with only 1 point.

Ref D13904
2022-02-03 22:40:32 +11:00
235941fe91 Merge branch 'patch/gpencil-update-on-write' into patch/gpencil-undo-system 2022-02-03 12:37:21 +01:00
f3cc017550 Merge branch 'master' into patch/gpencil-update-on-write 2022-02-03 12:29:25 +01:00
81a8f24227 Link to the correct task in the userpref options 2022-02-03 11:45:52 +01:00
9b42620ef2 Merge branch 'blender-v3.1-release' 2022-02-03 21:39:26 +11:00
35aedd87e7 Fix T66913: undo after frame-change doesn't refresh properly
Use the ID.recalc flag to detect when updates after frame-change is
needed. Since comparing the last calculated frame doesn't take undo into
account (see code-comment for details).

`ID_RECALC_AUDIO_SEEK` has been renamed to `ID_RECALC_FRAME_CHANGE`
since this is not only related to audio however internally this flag is
still categorized in `NodeType::AUDIO`.

Reviewed By: sergey

Ref D13942
2022-02-03 21:37:42 +11:00
98cc3c6009 Cleanup: clang-format 2022-02-03 21:32:31 +11:00
da6a96f334 Cleanup 2022-02-03 10:41:31 +01:00
b9483ea380 Merge branch 'blender-v3.1-release' 2022-02-03 10:02:36 +01:00
c8cca88851 Fix assert in original modifiers pointer update function
The issue was happening with a specific file where the ID management
code was not fully copying all modifiers because of the extra check
in the `BKE_object_support_modifier_type_check()`.

While it is arguable that copy-on-write should be a 1:1 copy there is
no real need to maintain the per-modifier pointer to its original.
Use its SessionUUID to perform lookup in the original datablock.

Downside of this approach is that it is a linear lookup instead of
direct pointer access, but the upside is that there is less pointers
to manage and that the file with unsupported modifiers does behave
correct without any asserts.

Differential Revision: https://developer.blender.org/D13993
2022-02-03 10:02:20 +01:00
45d5773519 Cleanup: Use utility function to access original modifier in RNA 2022-02-03 10:02:20 +01:00
c80411ce3b Despgraph: Remove asserts from object modifier backup
The modifiers are mapped between original and evaluated objects based on
their session IDs. The pointer to original modifier is no longer needed
for the backup: it remained from the initial implementation which was
rewritten at some point.

This is a preparation for removal of the pointer to original modifier.
2022-02-03 10:02:20 +01:00
e468abc360 Merge branch 'blender-v3.1-release' 2022-02-03 09:59:22 +01:00
c379223053 Fix wrong function call in Cycles acceleration UI poll.
Thanks to Sergey for spotting this mistake.
2022-02-03 09:57:24 +01:00
26fe2c1885 Merge branch 'blender-v3.1-release' 2022-02-03 17:20:47 +11:00
b0847eff2a Fix T93625: fallback tools don't work with RMB select
c9d9bfa84a caused a regression in when
the right-mouse select action was set to "Select & Tweak" (default).

Now the fallback tool works with RMB select as it did before.
2022-02-03 17:14:07 +11:00
50f8adeb5f Remove test light_updates 2022-02-02 19:23:55 +01:00
05836d4b76 Disable undo steps that have no update cache 2022-02-02 18:57:06 +01:00
a95d3854fd Rename undo system 2022-02-02 18:44:48 +01:00
ff3cc4e2e2 Fix typo 2022-02-02 17:24:35 +01:00
eb0e0a3b75 LibOverride: Move proxy conversion code in its own file.
This will allow to keep the access to deprecated DNA proxy data in that
specific file, instead of allowing deprecated accesses in the whole
override kernel code.

Part of T91671.
2022-02-02 17:22:12 +01:00
633de67467 Refactor exit conditions in encode
Co-authored-by: @yann-lty
2022-02-02 17:10:51 +01:00
a83fff7c63 Remove operators to manually convert proxies to liboverrides.
Now that proxy conversions if enforced, those operations are not useful
anymore.

Part of T91671.
2022-02-02 16:56:23 +01:00
f0cfa94d94 Fix T95397: Grease Pencil Icons do not match in Outliner vs Dope Sheet Editor
There was an inconsistency between icons.
2022-02-02 16:33:29 +01:00
04a93b795c Merge branch 'blender-v3.1-release' 2022-02-02 16:30:12 +01:00
43b0ff3054 Fix (unreported) bug in liboverride resync code.
Part of the resynching code would access collections' objects base
cache, which can be invalid at that point (due to previous ID remapping
and/or deletion). Use a custom recursive iterator over collections'
objects instead, since those 'raw' data like collection's objects list,
and collection's children lists, should always be valid.

Found while investigating a studio production file.
2022-02-02 16:25:41 +01:00
dfb8e1f895 Initial gpencil undo system patch
Co-authored-by: @yann-lty
2022-02-02 15:22:01 +01:00
40b84ffc50 Draw Manager: Marked work around code.
Mark the work around that was added for the VSE memory leak.
2022-02-02 15:05:06 +01:00
fd35aa48d1 Workaround for VSE memory leak.
This is a temp fix for a memory leak where the VSE isn't aware that a
float representation of the image could exist. The VSE somehow doens't
clears it (refcounter is still 1).

The work around is just to let the image engine clean up all the data it
created. Potential this would add more overhead when buffers are needed
more than once.
2022-02-02 14:20:18 +01:00
b6097a659e Merge branch 'master' into patch/gpencil-update-on-write 2022-02-02 13:33:36 +01:00
e54fba5591 Merge branch 'blender-v3.1-release' 2022-02-02 13:12:12 +01:00
bf8597febe BLI: fix memory leak in VectorSet
The leak happened when the vector set had to grow when it
was empty but it had allocated the keys array already.
2022-02-02 13:11:33 +01:00
a28f40109c Merge branch 'master' into patch/gpencil-update-on-write 2022-02-02 12:42:35 +01:00
267ec53920 Fix memory leak for full updates on strokes 2022-02-02 12:31:20 +01:00
0edb771ad5 Add light updates to layers in the rna update 2022-02-02 11:48:44 +01:00
bcdbf76c57 Add comments to DNA for BKE_*_copy_settings functions 2022-02-02 11:48:17 +01:00
2b29a008c1 Simplify cache_node_update and add comments 2022-02-02 11:47:36 +01:00
7119e69e4a Rename struct_copy to light_copy 2022-02-02 11:47:00 +01:00
4dcaac6d33 Cleanup: comment printing when loading XML
This printed text when the theme was changes from the quick setup.
Also use a context manager for opening a file.
2022-02-02 21:06:38 +11:00
d81c3bcfbb Merge branch 'blender-v3.1-release' 2022-02-02 10:56:00 +01:00
a985f558a6 Fix T95084: evaluate all output attributes before changing geometry
This refactors how output attributes are computed in the geometry
nodes modifier. Previously, all output attributes were computed one
after the other. Every attribute was stored on the geometry directly
after computing it. The issue was that other output attributes might
depend on the already overwritten attributes, leading to unexpected
behavior.

The solution is to compute all output attributes first before changing the
geometry. Under specific circumstances, this refactor can result in a speedup,
because output attributes on the same domain are evaluated together now.
Overwriting existing might have become a bit slower, because we write the
attribute into  new buffer instead of using the existing one.

Differential Revision: https://developer.blender.org/D13983
2022-02-02 10:54:54 +01:00
ff4e04a293 Merge branch 'blender-v3.1-release' 2022-02-02 10:38:24 +01:00
71b451bb62 Fix T95288: Shrinkwrap selection broken in edit mode
Mistake in the 974981a637: f the edit data is not present then the
origindex codepath is to be used. Added a brief note about it on the
top of the file.

More ideally would be to remove edit mesh from non-bmesh-wrappers
but this would require changes in the draw manager to make a proper
decision about drawing edit mode overlays.
2022-02-02 10:35:32 +01:00
Falk David
c876bccb57 GPencil: Update-on-write using update cache
This implements the update cache described in T95401 and uses it for drawing strokes as well as sculpting (using the push brush).

**Note: Making use of the cache throughout grease pencil will have to be done incrementally in other patches. **

Demo on an Intel® Core™ i7-9700 CPU @ 3.00GHz with 8 cores:
{F12839817 width=100%}

Remaining issues:
 - [ ] Fix memory leaks

Design task: T95401
Co-authored-by: @yann-lty

Maniphest Tasks: T95401

Differential Revision: https://developer.blender.org/D13984
2022-02-02 09:51:35 +01:00
4003753bf0 Merge branch 'master' into greasepencil-object 2022-02-02 09:50:40 +01:00
829d93ff06 Remove option to not auto-convert proxies on file load.
Now all proxies will always be converted to library overrides. If
conversion fails, they are simply 'disabled'.

This should be the last 'user-visible' step of proxies removal.
Remaining upcoming commits will remove internal ID management, depsgraph
and evaluation code related to proxies.

Also bump the blendfile subversion.

Part of T91671.
2022-02-02 09:47:10 +01:00
049df7ef94 Proxies Removal: Handle conversion to liboverrides also for linked data.
So far linked proxies were just kept as-is, this is no longer an option.

Attempt to convert them into liboverrides as much as possible, though
some cases won't be supported:
- Appending proxies is broken since a long time, so conversion will fail
  here as well.
- When linking data, some cases will fail to convert properly. in
  particular, if the linked proxy object is not instanced in a scene
  (e.g. when linking a collection containing a proxy as an
  epty-instanced collection instead of a view-layer-instanced collection).

NOTE: converion when linking/appending is done unconditionnaly, option
to not convert on file load will be removed in next commit anyway.

Part of T91671.
2022-02-02 09:47:10 +01:00
286fcb3a60 LibOverride: Add 'owner library' info to some liboverride code.
This will help when dealing with liboverrides from other library files,
e.g for resync or proxies conversion.

This commit only affects proxy conversion.

Part of T91671.
2022-02-02 09:47:10 +01:00
4927919613 Cleanup: Use correct identifier for ShaderParameters.
Code use struct and class, but should only have used struct.
2022-02-02 08:32:32 +01:00
e8b3bd15e8 Cleanup: skip redundant steps when the selection buffer is cached
The viewport theme loaded and virtual modifiers allocated unnecessary.
2022-02-02 18:12:53 +11:00
da5e72eb01 Cleanup: exclude bone names & axes from selection drawing
These aren't used for picking bones so there is no need to draw them.
2022-02-02 18:06:51 +11:00
cabc9506f9 Fix crash in recent pose-bone transform cleanup
ff5e8e6d53 dereferenced a NULL pointer
when dragging a bone with a connected parent in pose-mode.
2022-02-02 18:02:13 +11:00
709f67cbf0 Docs: note that Bone.xwidth & zwidth are doubled 2022-02-02 17:31:06 +11:00
9b779993f0 Docs: add doc-string for RNA_property_is_set_ex use_ghost argument 2022-02-02 13:53:46 +11:00
d82372aee3 Cleanup: spelling in comments 2022-02-02 13:53:46 +11:00
811606a064 Cleanup: shadow warning, remove unused flags 2022-02-02 13:53:36 +11:00
9cc4861e6f Compositor: Combine and Separate XYZ Node
We have this node for shader and geometry nodes. Compositor can also
work with vectors, and this can help with that.

Reviewed By: manzanilla

Maniphest Tasks: T95385

Differential Revision: https://developer.blender.org/D12919
2022-02-01 18:18:51 -05:00
c9b578eac8 Geometry Nodes: Remove object transform dependency in some cases
The geometry nodes modifier currently always adds a dependency
relation from the evaluated geometry to the object transform. However,
that can be avoided unless there is a collection or object info node in
"Relative" mode.

In order to avoid requiring dependency graph relations updates often
when editing a node tree, this patch doesn't check if the node is muted
or if the data-block sockets are empty before adding the dependency.

Fixes T95265

Differential Revision: https://developer.blender.org/D13973
2022-02-01 16:27:29 -06:00
b91ae8b14c Merge branch 'blender-v3.1-release' 2022-02-01 22:54:23 +01:00
95fcb41841 Fix T95378: Seek problems when timecodes are used
Function `IMB_indexer_get_seek_pos()` can return non 0 seek position for
frame index 0. This causes seeking to incorrect GOP and scanning ends
with failiure.

Hard-code first frame index seek position to 0.

Differential Revision: https://developer.blender.org/D13974
2022-02-01 22:53:24 +01:00
6b914a43ad Fix error in ff5e8e6d53
And silence unused variable warning.
2022-02-01 18:50:10 -03:00
b127654816 Fix build error
The return value of this function was removed in ff5e8e6d53
2022-02-01 15:46:07 -06:00
a12265f048 Fix T95353: Crash with proxy auto building
Proxy building data were freed before process was started.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D13972
2022-02-01 22:46:04 +01:00
03e580c98c Cleanup: Use C++ types 2022-02-01 15:42:04 -06:00
ff5e8e6d53 Cleanup: restructure 'transform_convert_pose_transflags_update'
Move the bones count and `has_translate_rotate` parameter out of the
function as they are not required in some places.
2022-02-01 18:38:26 -03:00
Yevgeny Makarov
7aec5b0622 UI: Adjust Layout on Quick Setup Screen
Some items on the Quick Setup screen can be truncated with some
languages and/or with High DPI monitors. This patch adjusts column
sizes and turns off the expand on Spacebar options, making everything
fit a bit better.

See D9853 for more details.

Differential Revision: https://developer.blender.org/D9853

Reviewed by Julian Eisel
2022-02-01 11:17:57 -08:00
2b01964e6c Merge branch 'blender-v3.1-release' 2022-02-01 19:25:36 +01:00
83b6c8f2b1 Fix T95278: Crash on startup because of GLSL recursion
Bypassing the defines which are only there for error checking.
2022-02-01 19:22:50 +01:00
f39ade9e00 GPUShader: Rename createInfo storage Qualifiers
Using opt-in instead of opt-out to make code easier to read.
Add combined flag enum.
Making restrict an inverse flag option because it is so rare to
use it.
2022-02-01 19:05:22 +01:00
9505af72d4 GPUShader: Add support for gpu_BaryCoord and fallback
This adds the possibility to use the `gpu_BaryCoord[NoPersp]`
builtin to support barycentric coordinates without geometry shader.

The `BuiltinBits::LAYER` builtin needs to be manually added
to the `GPUShaderCreateInfo` in order to use this feature.
Note: This is only available for shaders using `GPUShaderCreateInfo`.

A geometry shader fallback is generated if the extension
`AMD_shader_explicit_vertex_parameter` is not available.

`NV_fragment_shader_barycentric` was not considered because it is not
present inside the `glew.h` with use and seems to only be available
with vulkan.
2022-02-01 19:05:22 +01:00
9e42b9827a GPUShader: Add support for vertex shader gl_Layer and fallback
This adds the possibility to use the `gpu_Layer` builtin to
support layered rendering without geometry shader.

The `BuiltinBits::LAYER` builtin needs to be manually added
to the `GPUShaderCreateInfo` in order to use this feature.
Note: This is only available for shaders using `GPUShaderCreateInfo`.

A geometry shader fallback is generated if the extension
`AMD_shader_explicit_vertex_parameter` is not available.
2022-02-01 19:05:22 +01:00
9bbfade772 GPUShader: Improve builtins support in GPUShaderCreateInfo
- Scan all static shaders for builtins on startup.
- Add possibility to manually add builtins.
- `ShaderCreateInfo.builtins_` contain builtins from all stages.
2022-02-01 19:05:22 +01:00
7475f7b0de GPUShader: Expose create_info getter
This allows to check if a create_info extists based on its name.
2022-02-01 19:05:22 +01:00
e253e0ea86 Link to the correct task 2022-02-01 18:46:20 +01:00
Falk David
ffb0ecb498 Fix T91463: Separate points makes gap on cyclic stroke
If an entire cyclic stroke was selected, calling "Separate by Points"
would leave a gap in the new object (making the new stroke non-cyclic).

The patch makes sure that if we separate by points and all points are
selected, we fall back to separate by stroke.

Reviewed By: antoniov

Maniphest Tasks: T91463

Differential Revision: https://developer.blender.org/D12527
2022-02-01 18:09:34 +01:00
2110e271f5 Merge branch 'blender-v3.1-release' 2022-02-01 17:53:19 +01:00
2bd71b49e7 Fix T95395: dangling parent pointer when creating node group
Differential Revision: https://developer.blender.org/D13981
2022-02-01 17:48:44 +01:00
54ff7261e7 Merge branch 'master' into patch/gpencil-update-on-write 2022-02-01 17:28:26 +01:00
8b6330dfbe Add code documentation
Co-authored-by: Yann Lanthony <ylanthony@thespastudios.com>
2022-02-01 17:22:37 +01:00
Falk David
e9150ac317 Fix T89514: GP draw mode not saved when scene is not the active one
This patch fixes the error that pops up
(`Error: Unable to execute '... Mode Toggle', error changing modes`)
when trying to switch to e.g. draw mode from a grease pencil object
that was saved in draw mode in an inactive scene when the file was loaded.

Note that this does not fix the bigger issue described in T91243.

The fix makes sure that we reset all the mode flags on the grease pencil
data when we set the mode to object mode.

Reviewed By: antoniov

Maniphest Tasks: T89514

Differential Revision: https://developer.blender.org/D12419
2022-02-01 16:02:03 +01:00
Yann Lanthony
ae68624472 GPencil: improve comment in paint code 2022-02-01 15:45:09 +01:00
Yann Lanthony
88f80c3b73 GPencil: ensure update cache is not copied to eval data
When falling back to a copy-on-write, clear the runtime
update cache before copying the id to eval.
2022-02-01 15:26:50 +01:00
32b33e91eb Asset Browser: Use directory name as default when adding asset libraries
When adding an asset library in the Preferences, set the name of the new
library to the chosen directory's name by default. That avoids having to
set it manually which can be annoying. Previously I thought it would be
nice to show the name button in red then, making the user aware that
they have to give it a name, but that appears to be more annoying than
useful/practical after all.
2022-02-01 14:59:11 +01:00
b03fb70eff Silence draw manager warning.
This message isn't useful for users so silenced it.
2022-02-01 13:50:19 +01:00
Falk David
7a1bfbba60 GPencil: Update-on-write using update cache 2022-02-01 13:39:40 +01:00
f8713aae5e Cleanup: Remove unused datatoc definitions. 2022-02-01 12:14:52 +01:00
217e0a2ce6 Fix T95262: instances ignored in Frame Selected operator
The issue was that the code only looked at `dob->ob`
instead of `dob->ob_data` which is necessary since
rB5a9a16334c573c4566dc9b2a314cf0d0ccdcb54f.

This now uses the same pattern that is used in other places
where `BKE_object_replace_data_on_shallow_copy` is used.
2022-02-01 11:58:53 +01:00
84dab8b597 Fix T95314: constant values not shown in spreadsheet 2022-02-01 11:43:48 +01:00
34449ba9a6 Merge branch 'blender-v3.1-release' 2022-02-01 11:04:38 +01:00
6f9828289f Fix T95356: Crash in armature edit mode and certain condition
Blender would have crashed when renaming bone in Edit Mode, Saving, and
than selecting/deselecting.

Caused by a mistake in the 0f89bcdbeb: can not "short-circuit" the
CoW update if it was explicitly requested.

Safest for now solution seems to be to store whether the CoW component
has been explicitly tagged, so that the following configuration can be
supported:

    DEG_id_tag_update(id, ID_RECALC_GEOMETRY);
    DEG_id_tag_update(id, ID_RECALC_COPY_ON_WRITE);

Differential Revision: https://developer.blender.org/D13966
2022-02-01 11:04:19 +01:00
396413dedf Partial Fix: Showing Compositor Backdrop in node editor.
Since splitting the depth and the color shader in the image engine the
backdrop wasn't visible anymore. The reson is that the min max uv
coordinates were never working for the node editor backdrop that uses
its own coordinate space.

This partial fix will ignore the depth test when drawing the color part
of the backdrop. This will still have artifacts that are visible when
showing other options as RGBA.

Proper fix would be to calculate the the uv vbo in uv space and not in
image space.
2022-02-01 10:49:28 +01:00
146618fb22 Fix T95376: Fix crash when switching to UV workspace.
Can also happen in other places when the overlay engine is active. Some
parts of the overlay engine uses builtin shaders, but disable the color
space conversion to the target texture.

Currently there the overlay engine has its own set of libraries it could
include and defined a macro to pass-throught the color space conversion.

The library include mechanism currently fails when it couldn't find the
builtin library in the libraries of the overlay engine. This only
happened in debug mode.

This change will not fail, but warns the developer if a library could
not be included. In the future this should be replaced by a different
mechanism that can disable the builtin library. See {T95382}.
2022-02-01 08:38:34 +01:00
120deaac5b Merge branch 'blender-v3.1-release' 2022-02-01 15:37:14 +11:00
64264a496d Merge branch 'blender-v3.1-release' 2022-02-01 15:37:10 +11:00
c8814fb610 Fix T95185: Invalid normals after undo in sculpt mode
Since d9c6ceb3b8 partial updates to
normals in sculpt-mode were accumulating into the current normal
instead of a zeroed value.

Zero vertex normal values tagged for calculation before accumulation.

Reviewed By: HooglyBoogly

Ref D13975
2022-02-01 15:35:08 +11:00
9ce1135440 Cleanup: remove duplicate vertex normal array in SculptSession
From investigating T95185, it's important the normal returned by
SCULPT_vertex_normal_get always match the PBVH normal array.

Since this is always initialized in the PBVH, there is no advantage
in storing the normal array in two places, it only adds the possibility
that changes in the future causing different meshes normals to be used.

Split out from D13975.
2022-02-01 13:39:19 +11:00
f21f1279fa Merge branch 'blender-v3.1-release' 2022-02-01 13:34:43 +11:00
2e4a1a70da Fix building with audaspace disabled 2022-02-01 13:33:50 +11:00
95005bbe02 Merge branch 'blender-v3.1-release' 2022-02-01 00:10:47 +01:00
f420118335 Fix T93856: VP9 lossless render missing alpha
Since 0ea0ccc4ff, `AV_PIX_FMT_YUV444P` pixel format was used for
lossless renders, which did override `AV_PIX_FMT_YUVA420P` format when
"RGBA" output is chosen. VP9 encoder doesn't seem to support
`AV_PIX_FMT_YUVA444P` pixel format, so use `AV_PIX_FMT_YUVA420P` for
lossless RGBA ouput instead.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D13947
2022-02-01 00:00:29 +01:00
1d1859c3c4 Fix compile error with audaspace disabled
Argument was removed in a recent commit.
2022-01-31 23:48:43 +01:00
bff83ecee5 Cleanup: Add missing breaks in previous commit
I missed compile warnings for these. Sorry for the noise.
Also combine assignments with null checks to save a few lines.
2022-01-31 15:43:23 -06:00
71c76d596c Merge branch 'blender-v3.1-release' 2022-01-31 22:32:08 +01:00
2053fc849e Cleanup: Return early, use switch, rename function 2022-01-31 15:27:35 -06:00
68c2650b03 Fix T94287: gaps between strips when adding movies
Currently, audio and video strips are synchronized based on data from
media stream, which is nice, but this causes gaps between strips.
This synchronization was implemented by moving movie strip position
relative to sound, which doesn't make much sense for user which is
mostly interested in editing video.

Code was bit hard to read, so it has been simplified. Ideally video
stream time would be easily accessible so synchronization could be done
at any time, but this is not necessary at this point.

Reviewed By: zeddb

Differential Revision: https://developer.blender.org/D13948
2022-01-31 22:22:36 +01:00
c3a41a8002 Merge branch 'blender-v3.1-release' 2022-01-31 21:00:28 +01:00
c8c9965df2 Fix crash with non-closed meshes in recent bugfix for texture margin
Ref T95249, D13935
2022-01-31 20:59:25 +01:00
5fabbedb04 Fix Cycles assert in light sampling
There is no object transform on lights.
2022-01-31 20:45:12 +01:00
c4f159cfcd Cleanup: Add back comment removed in recent commit
23775f3914 removed this comment, but it's
preferred to keep it instead.
2022-01-31 12:00:45 -06:00
81ee46da1a Fix: Unutilized curve mapping in vector shader node
This could result in a shading errors is some cases such as undo.

Follow up to rB1405787142d1f87f18631114167675ed145f6d75
2022-01-31 12:59:54 -05:00
716d8436f0 Fix: Unutilized curve mapping in vector shader node
This could result in a shading errors is some cases such as undo.

Follow up to rB1405787142d1f87f18631114167675ed145f6d75
2022-01-31 12:56:40 -05:00
64359f8998 Cleanup: Better name for new Outliner tree element type
The name `type` was confusing, since we usually use that in other ways.

Also updated the relating comments.
2022-01-31 18:36:55 +01:00
fc5ef2452d Cleanup: Namespace alias for internal outliner header
Long namespace qualifiers add visual noice and make code harder to read.
2022-01-31 18:36:55 +01:00
2bd30272ea Merge branch 'blender-v3.1-release' 2022-01-31 12:32:31 -05:00
Leon Schittek
5edb924e57 UI Papercut: Fix gap in node outline
Correct corner radius of the node outline to prevent a noticeable gap in
some cases.

---

Currently we make a small mistake in the creation of the node outline:
We offset the rectangle describing the outline by the outline thickness,
but we don't adjust the corner radius accordingly.
Therefore the rounded corner of the outline and the node body are not
concentric which can sometimes lead to a visible gap at the corner.
How noticeable it is depends on the theme, the screen's dpi and the
line thickness set in the preferences.

Simply adjusting the corner radius for the outline to also be increased
by the outline thickness fixes this small issue.

| display, line thickness | **patch** | **master** |
| --- | --- | --- |
| 1080p, default/thin  | {F12835304} | {F12835305} |
| retina, thin | {F12835306} | {F12835307} |

The issue was mentioned by @hitrpr

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D13955
2022-01-31 12:31:54 -05:00
Martijn Versteegh
8ad5241778 Fix T95250: bake margin adjacent faces uses stale UV map in edit mode
Use the evaluated mesh to generate the Adjacent Faces margin.

Baking used the evaluated mesh, but generating the margin used the base
mesh. This would lead to generating the margin from a stale UV map when the
UV editor was open and the UV map was changed. Fix it by passing the same
mesh as used for baking through to the margin generation.

Differential Revision: https://developer.blender.org/D13938
2022-01-31 18:18:05 +01:00
Martijn Versteegh
83fa6a1b2a Fix T95249: bake margin adjacent faces fails in some directions
The new adjacent faces method border lookup fails in some directions around
45 degrees

* Use 8 Dijkstra directions (also diagonally) to determine which polygon is the
  closest to each pixel. Using only Manhattan distance lead to large parts of
  the texture which were matched with the wrong polygon.

* Use neighbroing polygons for edge search. The Adjacent Faces algorithm needs
  to determine the closest edge, in UV space, each pixel. To speed this up
  first as map is built which finds the closest polygon for each pixel along
  horizontal, vertical and diagonal steps. Because this can sometimes be one
  edge off we first look in the polygon from the map, if that fails also
  check the edges of its neighbouring UV polygons.

Differential Revision: https://developer.blender.org/D13935
2022-01-31 18:18:04 +01:00
Martijn Versteegh
c626301f19 Cleanup: remove wrong assert
Was accidentally left in after refactoring.

Fixes T95347

Differential Revision: https://developer.blender.org/D13963
2022-01-31 18:18:02 +01:00
64ca0f44cb Merge branch 'blender-v3.1-release' 2022-01-31 17:43:43 +01:00
5257257539 Fix T95205: remove attribute only once
The bug was caused by a typo.
2022-01-31 17:40:55 +01:00
9578fe3068 Fix T95341: BGL renders incorrect color
Missing include statements of the gpu_shader_colorspace_lib.glsl in
various shaders ignored the target texture color space.
2022-01-31 15:43:13 +01:00
2216699c64 Cleanup: Change NULL to nullptr. 2022-01-31 15:43:13 +01:00
8cc6623c18 Merge branch 'blender-v3.1-release' 2022-01-31 15:29:02 +01:00
180a68c1dc Fix (studio-reported) missing RNA path for EEVEE render passes.
For those EEVEE passes a bit of trickery with pointer offsets allows to
get the owning viewlayer, so path generation is not too bad.

Also moved ViewLayer path generation itself into a public utils, to
avoid duplicating code.

NOTE: Doing the same for AOV would be needed, but since pointer offsets
won't help us here to find the owning viewlayer, not sure how to do it
nicely yet (only solution I think is to loop over all AOVs of all
ViewLayer of the scene to find it :( ).

Reported by Beau Gerbrands (@Beaug), thanks.
2022-01-31 15:16:36 +01:00
46abc6ce25 Fix T95238: BPY Documentation for Tablet Pressure is Incorrect
Set an appropriate range and default value for the property.
2022-01-31 10:20:34 -03:00
caaec3e0c5 Merge branch 'blender-v3.1-release' 2022-02-01 00:02:08 +11:00
a31859c754 Merge branch 'blender-v3.1-release' 2022-02-01 00:02:05 +11:00
8b4f1e41ea Merge branch 'blender-v3.1-release' 2022-02-01 00:02:02 +11:00
cf871ab967 Merge branch 'blender-v3.1-release' 2022-02-01 00:01:58 +11:00
9badd27fb7 Merge branch 'blender-v3.1-release' 2022-02-01 00:01:54 +11:00
b9718899fa Python: default to version to 3.10 for Linux
This doesn't bump the minimum version, see D13943.
2022-01-31 23:57:10 +11:00
deb90557ea Fix T95332: Crash loading older files.
Image buffer was visible but buffer wasn't available. In the case
the color only overlay of the render result was displayed the image
buffer was not check to be valid.

This patch adds a null pointer check to check in `IMB_alpha_affects_rgb`
to solve this crash.
2022-01-31 12:25:18 +01:00
869180548c Image editor: Fix drawing artifacts with render results.
Use the input depth texture to determine if the color of the texture
should be shown.
2022-01-31 11:59:16 +01:00
75576a3001 Fix (unreported) install_deps: wrong order of actions in python handling.
We need to get installed version of python *after* we actually install/update
the package.
2022-01-31 11:08:14 +01:00
Michael
e43ccfb702 Fix: Specify exact Python version for python3-dev on Debian&Ubuntu
This commit specifies the exact Python version which is included in the
package name, thereby allowing `install_deps.sh` to suggest
"`-D PYTHON_VERSION=3.10`" correctly.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D13925
2022-01-31 10:59:38 +01:00
dfc959eed6 Fix T95299: Empty render results show transparency checkerboard.
When an image buffer cannot be read the checkerboard should not be
drawn.
2022-01-31 10:51:25 +01:00
cfa235b89d Image Editor: Fix background drawing of empty tiles.
Empty (UDIM) tiles where drawn with a transparency checkerboard. They
should be rendered with a border background. The cause is that the image
engine would select a single area that contained all tiles and draw them
as being part of an image.

The fix is to separate the color and depth part of the image engine
shader and only draw the depths of tiles that are enabled.
2022-01-31 09:57:51 +01:00
a727692af7 XR: Print OpenXR SDK version in --debug-xr mode
Helps with version validation when updating the OpenXR dependency.
2022-01-31 16:09:17 +09:00
ed80c887b7 Fix wmTimer.ntime becoming NAN with a zero time-step
While this didn't cause any user visible bugs, this wouldn't
have behaved as intended since the timer would never run again once
wmTimer.ntime was set to NAN.
2022-01-31 14:36:37 +11:00
97dbe235a2 Cleanup: comments and minor changes to GPU_select code
- Remove outdated references to glReadPixels & OpenGL.
- Rename GPUPickState.{gl => gpu}
- Add doc-string for MAXPICKELEMS.
- Use doxygen comments & other minor doc-string improvements.
2022-01-31 14:10:38 +11:00
8815f2f116 Cleanup: use struct for GPU the select buffer
GPU_select originally used GL_SELECT which defined the format for
storing the selection result.

Now this is no longer the case, define our own struct - making the code
easier to follow:

- Avoid having to deal with arrays in both `uint*` and `uint(*)[4]`
  multiplying offsets by 4 in some cases & not others.

- No magic numbers for the offsets of depth & selection-ID.

- No need to allocate unused members to match GL_SELECT
  (halving the buffer size).
2022-01-31 14:10:08 +11:00
9ccdad8a21 Cleanup: use enum type for selection mode & internal algorithm enum 2022-01-31 13:06:56 +11:00
57f6aa4d83 Cleanup: Remove unused "_ex" version of function 2022-01-30 18:15:38 -06:00
79032a8513 Cleanup: Remove unused DerivedMesh flag
The value of this flag was never used.
2022-01-30 18:11:20 -06:00
23775f3914 Cleanup: Remove unused DerivedMesh functions
Remove functions and function pointers that were never set or never
used at all. The "tessface" original index handling in `subsurf_ccg.c`
can be removed because the data was never used.
2022-01-30 18:06:47 -06:00
ac3324f197 Cleanup: spelling in comments 2022-01-31 10:51:33 +11:00
012e41fc8b Cleanup: use our own conventions for tags in comments 2022-01-31 10:49:59 +11:00
14427f5aaa Cleanup: Remove unused DerivedMesh normal handling
This function and flags weren't used outside of DerivedMesh
code, and since the plan is to remove the data structure, it makes
sense to remove complexity where possible.
2022-01-30 17:01:03 -06:00
a04d0de039 Fix T95336: Wrong tooltip for Show Only on Keyframed checkbox
The "Paint" mode is wrong, must be "Draw"
2022-01-30 23:12:23 +01:00
Aras Pranckevicius
1f7013fb90 Speed up the new OBJ exporter via bigger write buffer and parallelization.
This is a patch from Aras Pranckevicius, D13927. See that patch for full
details. On Windows, the many small fprintfs were taking up a large amount
of time and significant speedup comes from using snprintf into chained buffers,
and writing them all out later.
On both Windows and Linux, parallelizing the processing by Object can also lead
to a significant increase in speed.
The 3.0 splash screen scene exports 8 times faster than the current C++ exporter
on a Windows machine with 32 threads, and 5.8 times faster on a Linux machine
with 48 threads.

There is admittedly more memory usage for this, but it is still using 25 times
less memory than the old python exporter on the 3.0 splash screen scene, so
this seems an acceptable tradeoff. If use cases come up for exporting obj files
that exceed the memory size of users, a flag could be added to not parallelize
and write the buffers out every so often.
2022-01-30 15:03:31 -05:00
b315678fea Merge branch 'blender-v3.1-release' 2022-01-30 13:57:45 -05:00
Aras Pranckevicius
07514def19 Fix T95328, new obj exporter not exporting custom normals.
Previously, the new obj exporter was only exporting per-vertex normals for faces
marked as "smooth". But a face can have custom normals, as soon as the normals
data layer exists. This change makes it follow the behavior of USD & Collada
exporters and the old Python one, which also export per-vertex normals as soon
as the layer is there. (From Patch D13957.)
2022-01-30 13:48:03 -05:00
4fcc651435 Revert "UI: Do not translate "Blender""
See rB0c5a9a0e776eeb724f7266694153f98721e34fde for the issue with this.

This reverts commit 0c5a9a0e77.
2022-01-30 12:19:38 -05:00
a58592885c Cleanup: Remove modifier type hair callback
This is similar to e032ca2e25 which removed the
callback for volumes. Now that we have geometry sets, there is
no need to define a callback for every data type, and this wasn't
used. Procedural curves/hair editing will use nodes rather than new
modifier types anyway.
2022-01-30 00:07:07 -06:00
0c5a9a0e77 UI: Do not translate "Blender"
Blender is the name of the software, it does not make sense to
translate into a language's term for the kitchen appliance.
2022-01-29 21:00:12 -05:00
f18172b023 Cleanup: Pass cursor position as a single array to eyedropper functions
Since `event->xy` is now an array these functions can be
simplified to accept the sample point as an array.

Clarifications were also made to variable names:
- `eye->last_x/y` --> `eye->cursor_last`
- `mx/my` --> `cursor`

Differential Revision: https://developer.blender.org/D13671
2022-01-29 20:45:03 -05:00
f8b8727873 Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-01-30 01:07:38 +01:00
2cf3ed13da Fix T95315: "Override Layers" panel open crash with null CacheFile 2022-01-30 01:06:56 +01:00
e951e81b0f Cleanup: Cmake: remove unnecessary definitions for internationalization
Previously, macros were ifdefed using the cmake option `WITH_INTERNATIONAL`
However, the is unnecessary as withen the functions themselves have checks for building without internationalization.
This also means that many `add_definitions(-DWITH_INTERNATIONAL)` are also unnecessary.

Reviewed By: mont29, LazyDodo

Differential Revision: https://developer.blender.org/D13929
2022-01-29 17:40:27 -05:00
ec2e9a4352 Merge branch 'blender-v3.1-release' 2022-01-29 13:14:45 -05:00
c9d35ee07c Fix: Eevee: Float Curve node causes issues with compiled shader
This fixes a regression from rBa0edee712a79239133ff840f911f6416d4c41855.
Issue being the curve map not being initialized in the GPU shader function.

Fixes T95221
2022-01-29 13:14:26 -05:00
1405787142 Fix: Eevee: Float Curve node causes issues with compiled shader
This fixes a regression from rBa0edee712a79239133ff840f911f6416d4c41855.
Issue being the curve map not being initialized in the GPU shader function.

Fixes T95221
2022-01-29 13:11:06 -05:00
90a23dec46 Cleanup: Remove mesh vertex "temp tag" flag
As part of the project of converting `MVert` into `float3`
(more details in T93602), this is an easy step, since it
is only locally used runtime data. In the six places it was
used, the flag was replaced by a local bitmap.

By itself this change has no benefits other than making some
code slightly simpler. It only really matters when the other
flags are removed and it can be removed from `MVert`
along with the bevel weight.

Differential Revision: https://developer.blender.org/D13878
2022-01-28 22:40:13 -06:00
0b2864382a Merge branch 'blender-v3.1-release' 2022-01-29 01:42:04 +01:00
544a0f2880 Fix memory leak when adding movie strips
Introduced by b45e71e22c.
2022-01-29 01:31:53 +01:00
d29a079cb6 Merge branch 'blender-v3.1-release' 2022-01-28 17:47:38 -06:00
03b57d3973 Fix T94476: Threading/performance issue with curve to points node
For every spline, *all* of the normals and tangents in the output
were normalized. The node is multithreaded, so sometimes a thread
overwrote the normalized result from another thread.

Fixing this problem also made the node orders of magnitude
faster when there are many splines.
2022-01-28 17:47:14 -06:00
fd1078e105 Fix T62651: Win32 Multiple Adapters Warning
Show a more instructive error message for users who have plugged
multiple monitors into multiple display adapters. And do not exit
if unable to open a child window when in this state.

See D13885 for more details

Differential Revision: https://developer.blender.org/D13885

Reviewed by Ray Molenkamp
2022-01-28 15:20:07 -08:00
3435c9a2c1 Merge branch 'blender-v3.1-release' 2022-01-28 23:51:50 +01:00
afdc35b636 Fix typos in rB0a8fa07735cdb89081b652c032c73863e34f8ff1 2022-01-28 23:50:49 +01:00
fe80b6ceac Merge branch 'blender-v3.1-release' 2022-01-28 23:32:51 +01:00
0a8fa07735 Fix T95278: Crash on startup because of GLSL compiler bug
The GLSL defines used to make the uniform names unusable for local variable
is being interpreted as recursive on some implementation.

This avoids it by create a second macro avoiding the recursion.
2022-01-28 23:28:53 +01:00
6b7756279f Fix T93626: Win IME Chinese Numpad Decimal
Allow Windows IME Pinyin, when in Chinese mode, to use numpad decimal
key to enter decimal point.

See D13902 for more details.

Differential Revision: https://developer.blender.org/D13902

Reviewed by Brecht Van Lommel
2022-01-28 13:32:46 -08:00
4311a32bc2 Win IME: Ideographic Full Stop to Decimal Point
Convert Ideographic Full Stop, used in Simplified Chinese and Japanese,
to Decimal Point when entering numbers into numerical inputs.

See D13903 for more details

Differential Revision: https://developer.blender.org/D13903

Reviewed by Brecht Van Lommel
2022-01-28 13:11:56 -08:00
ace1b6a73a UI: Add OneDrive to System List for Windows
This patch adds a "OneDrive" icon to the File Manager System list for
Windows (only!).

See D11133 for more details.

Differential Revision: https://developer.blender.org/D11133

Reviewed by Julian Eisel
2022-01-28 12:22:42 -08:00
26e608d820 Win32: Initialize GHOST_WindowWin32 Members
Initialize m_Bar, m_dropTarget, & m_hWnd members of GHOST_WindowWin32
in constructor's member initializer list. This ensures they are are
set or NULL in destructor if constructor does not complete.

See D13886 for more details.

Differential Revision: https://developer.blender.org/D13886

Reviewed by Jesse Yurkovich
2022-01-28 12:03:20 -08:00
82ad1631e4 Fix Cycles assert in light sampling
There is no object transform on lights.
2022-01-28 17:32:18 +01:00
dd4a89e78d Merge branch 'blender-v3.1-release' 2022-01-28 10:06:04 -06:00
cb09485ff2 UI: Use property split in new operator popup
This attribute conversion operator was just added.
The UI looks more consistent with property split.
2022-01-28 10:03:07 -06:00
92d747b0c4 Drag & drop: Support using context of hovered button when dropping
Buttons can hold context and it's very useful to use this as a way to
let buttons provide context for drop operators.
For example, with this D13549 can make the material slot list set the
material-slot pointer for each row, and the drop operator can just query
that.
2022-01-28 16:53:37 +01:00
391bb6e9ba Cleanup: Clang-tidy warning gl_shader.cc 2022-01-28 16:35:05 +01:00
b6f640b953 Cleanup: Clang-tidy warnings.
Silence Clang-tidy warnings in gpu module.
2022-01-28 16:18:13 +01:00
4e93918b35 Merge branch 'blender-v3.1-release' 2022-01-28 15:09:35 +01:00
3b2a1ff716 Image Engine: Remove unused shader parameter Color.
This change removes an unused shader parameter that also collided when a
local varialble with the same name was used on different platforms.
2022-01-28 15:03:45 +01:00
75e61e5a6d Image Engine: Use GPUShaderCreateInfo.
Ported the image engine shaders to use the GPUShaderCreateInfo struct.
No functional changes.
2022-01-28 15:03:45 +01:00
c40d6ebceb Merge branch 'blender-v3.1-release' 2022-01-28 14:46:16 +01:00
430f71fce2 Fix insufficient CPU flags checks for Cycles OIDN
Sometime throughout development some checks got lost during refactor.
This change makes it so that if OIDN is not supported on the current
CPU Cycles will report an error and stop rendering. This behavior is
similar to when an OptiX denoiser is requested and there is no OptiX
compatible device available.

The easiest way to verify this change is to force return false from
the `openimagedenoise_supported()`.

Fixes Cycles part of the T94127.

Differential Revision: https://developer.blender.org/D13944
2022-01-28 14:28:04 +01:00
29a1d8b1d3 Fix compilation error in previous commit. 2022-01-28 14:01:25 +01:00
cdcbdf8ce4 Remove compilation warnings TexResult. 2022-01-28 13:28:31 +01:00
5d74fa314b Fix overread warning in screen operator
Fixes a `stringop-overread` warning, other people are working on fixing
some more :)
2022-01-28 12:40:44 +01:00
7c48196056 Silent compilation warning in space_graph. 2022-01-28 11:48:47 +01:00
be921a04f2 Image engine: Remove unused parameter.
Parameter was used to still be compatible with the previous drawing mode.
The previous mode isn't available anymore so the parameter can should be
removed.
2022-01-28 11:48:47 +01:00
dcb7b3f9f7 Image Engine: Fix issue show alpha flag not reset.
After showing the alpha in the image editor the setting was not reset
so all images in the editor showed as being transparent.

This commit fixes this by resetting the flag before updating.
2022-01-28 11:48:47 +01:00
379814a118 Draw: Remove unused code in image engine shader. 2022-01-28 11:48:47 +01:00
60bd6804db Revert "3.1 splashscreen"
This reverts commit 3aa56608f7.
2022-01-28 11:34:51 +01:00
1a15461612 Merge branch 'blender-v3.1-release' 2022-01-28 11:34:31 +01:00
3aa56608f7 3.1 splashscreen
Credit: Lorenzo Aiello - https://orencloud.artstation.com/
2022-01-28 11:32:12 +01:00
f4031f2be2 Revert "Update pipeline config and point to 3.1 branches."
This reverts commit 5d4583683b.
2022-01-28 11:19:29 +01:00
66e4fdab68 Revert "Blender 3.1 bcon3 (beta)"
This reverts commit d45098024e.
2022-01-28 11:19:10 +01:00
cfe18c3b94 Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-01-28 11:11:51 +01:00
f756dc4812 Blender 3.1 Beta- subversion bump 2022-01-28 11:11:11 +01:00
5d4583683b Update pipeline config and point to 3.1 branches. 2022-01-28 11:01:11 +01:00
d45098024e Blender 3.1 bcon3 (beta) 2022-01-28 10:55:28 +01:00
c37b837244 Fix T95060: Outliner: Broken 'make override hierarchy' in indirect linked casae.
In Outliner, 'Make Override Hierarchy' on an indirectly linked data would
fail in case some items higher up in the hierarchy also needed to be
overridden was also indirectly linked.
2022-01-28 10:53:53 +01:00
c0225aa573 Blender 3.2 bcon1 - alpha
Bump the version number for the new release cycle.
2022-01-28 10:48:27 +01:00
49b9b0251b Draw: Remove unused shader.
tile images aren't a special case anymore for the image engine.
2022-01-28 10:47:52 +01:00
78647fbcc0 Fix T95060: Outliner: Broken 'make override hierarchy' in indirect linked casae.
In Outliner, 'Make Override Hierarchy' on an indirectly linked data would
fail in case some items higher up in the hierarchy also needed to be
overridden was also indirectly linked.
2022-01-28 10:24:07 +01:00
e1be275878 Fix typo in comment. 2022-01-28 09:24:11 +01:00
Jeroen Bakker
bdd74e1e93 DrawManager: Image engine support huge images.
Adding better support for drawing huge images in the image/uv editor. Also solved tearing artifacts.
The approach is that for each image/uv editor a screen space gpu texture is created that only contains
the visible pixels. When zooming or panning the gpu texture is rebuild.

Although the solution isn't memory intensive other parts of blender memory usage scales together with
the image size.

* Due to complexity we didn't implement partial updates when drawing images tiled (wrap repeat).
  This could be added, but is complicated as a change in the source could mean many different
  changes on the GPU texture. The work around for now is to tag all gpu textures to be dirty when
  changes are detected.

Original plan was to have 4 screen space images to support panning without gpu texture creation.
For now we don't see the need to implement it as the solution is already fast. Especially when
GPU memory is shared with CPU ram.

Reviewed By: fclem

Maniphest Tasks: T92525, T92903

Differential Revision: https://developer.blender.org/D13424
2022-01-28 08:37:45 +01:00
0a32ac02e9 Image: Partial Update Redesign.
This patch reimplements the image partial updates. Biggest design motivation for the redesign
is that currently GPUTextures must be owned by the image. This reduces flexibility and adds
complexity to a single component especially when we want to have different structures.

The new design is not limited to GPUTextures and can also be used by reducing overhead in image
operations like scaling. Or partial image updating in Cycles.

The usecase in hand is that we want to support virtual images in the image editor so we can
work with images that don't fit in a single GPUTexture.

Using `BKE_image_partial_update_mark_region` or `BKE_image_partial_update_mark_full_update`
a part of an image can be marked as dirty. These regions are stored per ImageTile (UDIM).

When a part of the code wants to receive partial changes it needs to construct a `PartialUpdateUser`
by calling `BKE_image_partial_update_create`. As long as this instance is kept alive the changes can
be received.

When a user wants to update its own data it will call `BKE_image_partial_update_collect_changes`
This will collect the changes since the last time the user called this function. When the partial changes
are available the partial change can be read by calling `BKE_image_partial_update_get_next_change`

It can happen that the introduced mechanism doesn't have the data anymore to construct the
changes since the last time a PartialUpdateUser requested it. In this case it will get a request
to perform a full update.

Maniphest Tasks: T92613

Differential Revision: https://developer.blender.org/D13238
2022-01-28 08:06:19 +01:00
1e0758333d Cleanup: add compiler attributes to BLI_path functions 2022-01-28 15:06:29 +11:00
9523b1478e BLI_path: assert passing relative paths to BLI_path_cmp_normalized
Assert when "//" prefixed relative paths are passed to
BLI_path_cmp_normalized as this can't be expanded
and it's possible the paths come from different blend files.
2022-01-28 15:05:21 +11:00
ebd0e76088 Cleanup: indentation for CMake files
Also minor white-space & case changes.
2022-01-28 14:52:47 +11:00
9f6b19526d Cleanup: spelling in comments
Also minor wording improvements.
2022-01-28 14:52:47 +11:00
7475012e24 Cleanup: rename BLI_paths_equal to BLI_path_cmp_normalized
Changes to recent addition: c85c52f2ce.

Having both BLI_paths_equal and BLI_path_cmp made it ambiguous
which should be used, as `BLI_paths_equal` wasn't the equivalent to
`BLI_path_cmp(..) == 0` as it is for string equals macro `STREQ(..)`.
It's also a more specialized function which is not used for path
comparison throughout Blender's internal path handling logic.

Instead rename this `BLI_path_cmp_normalized` and return the result of
`BLI_path_cmp` to make it clear paths are modified before comparison.

Also add comments about the conventions for Blender's path comparison
as well as a possible equivalent to Python's `os.path.samefile`
for checking if two paths point to the same location on the file-system.
2022-01-28 14:50:16 +11:00
f2b24272dd Fix T93328: Movie seeking doesn't work.
Caused by integer overflow in `steps_per_frame` calculation.
2022-01-27 23:21:45 +01:00
da848b7440 GPUShader: Abort in case of dependency issues.
This is to avoid being flooded with compilation errors that are not helpful.
2022-01-27 22:57:02 +01:00
423bbbbaae BLI_float4x4: Add operator[]
This makes porting existing code using `float[4][4]` easier.
2022-01-27 21:35:43 +01:00
Germano Cavalcante
3775615aea Outliner: avoid creating unnecessary undo steps
The `OUTLINER_OT_item_activate` operator, although it detects when
something changes, always returns `OPERATOR_FINISHED` and thus induces
the creation of undo steps.

So return `OPERATOR_CANCELLED` when nothing changes.

Ref T94080

Reviewed By: Severin

Maniphest Tasks: T94080

Differential Revision: https://developer.blender.org/D13638
2022-01-27 15:41:40 -03:00
a21f1e81e0 DRW: Fix some issues with DRW_gpu_wrapper.hh
- Fix assert on size.
- Fix void * casting.
- Pass extent by values.
- Add swap function to avoid letting the types copyable.
- Add back the GPUTexture * operator on TextureFromPool.
2022-01-27 18:46:01 +01:00
87c13ac68c UX: Prevent click-through panels and used header area
Does two main changes:
* Handle regions in the order as visible on screen. Practically this
  just means handling overlapping regions before non-overlapping ones.
* Don't handle any other regions after having found one containing the
  mouse pointer.

Fixes: T94016, T91538, T91579, T71899 (and a whole bunch of duplicates)
Addresses: T92364

Differential Revision: https://developer.blender.org/D13539

Reviewed by: Campbell Barton
2022-01-27 18:40:54 +01:00
4710f3346a Event System: Add debug sanity check "always pass" events
Asserts that such events actually always lead to a handler return value
that actually keeps the event passing.

Reviewed by Campbell Barton as part of
https://developer.blender.org/D13539.
2022-01-27 18:40:54 +01:00
74d68e50d3 Revert "Cleanup: Remove unused variables in winstuff.c"
This reverts commit 32a96b80a3.

this needed an ifdef, not a removal, will land a proper fix later
2022-01-27 10:21:35 -07:00
89dbad9085 Fix T95202: Curve to mesh node inconsistent edge vertex order
Though the edge vertices aren't really meant to have an order,
it can make a difference in operations when there isn't any other
information to make decisions from, like etruding a circle of
loose edges (the situation in the report). This commit changes
the order of the vertices in the final cyclic edge to go in the
same direction as all of the other edges.
2022-01-27 11:21:07 -06:00
834b966b41 Fix T95212: Mirror modifier normals crash
The vertex and face normals from the input mesh
were used to calculate the normals on the result,
which could cause a crash because the result should
be about twice as large.

Also remove an unnecessary dirty tag, since it is handled
automatically when creating a new mesh or in the case
of the mirror modifier, when calculating the new custom
face corner normals.
2022-01-27 11:02:10 -06:00
d7ac659e02 Cleanup: Clang tidy
Use nullptr, use named parameters, fix deprecated header
2022-01-27 10:53:53 -06:00
9c341153a2 Fix T95062: Outliner Library Overrides not refreshed when removing overrides.
Those operations were missing the necessary notification for the
Outliner. This was also affecting RNA API of liboverrides.
2022-01-27 17:52:09 +01:00
279a73e429 Fix: Complete transfer attribute input renaming
Complete the renaming from 6a16a9e661
to include variable names and warning messages.
2022-01-27 10:41:41 -06:00
32a96b80a3 Cleanup: Remove unused variables in winstuff.c
This clears up 4 unused variable warnings coming
from BLI_windows_register_blend_extension
2022-01-27 09:37:11 -07:00
25ac6aa5e4 Fix T85233: Transfer Weights tooltip is wrong.
Swap "active" and "selected" in the tooltip if the `use_reverse_transfer`
option is activated.

Reviewed By: mont29

Maniphest Tasks: T85233

Differential Revision: https://developer.blender.org/D13499
2022-01-27 17:21:01 +01:00
658ae5d63f DRW: Fix DRW_gpu_wrapper.hh
The UBYTE datatype is not supported by the clear fallback. Also fix vector
types headers.
2022-01-27 17:05:02 +01:00
Yevgeny Makarov
58e0aa36ea Fix T93766: 'New Collection' entry in 'Move to collection' menu is not translated.
Also fixes similar issues regarding some liboverride menu entries.

Reviewed By: mont29

Maniphest Tasks: T93766

Differential Revision: https://developer.blender.org/D13513
2022-01-27 16:51:14 +01:00
99ffe1153a install_deps: Downgrade python-ztandard to 0.16.0.
Higher version requires a new version of the ztandard library itself.

Ref. T93161/D13922.
2022-01-27 16:16:14 +01:00
6c483479b8 GLFramebuffer: Add assert to check if framebuffer has the expected data
It came to light that there is no error checking when trying to read
a framebuffer plane without anything attached to it.
2022-01-27 16:13:49 +01:00
Michael Kowalski
c85c52f2ce USD Preview Surface material export.
Add `USD Preview Surface From Nodes` export option, to convert a
Principled BSDF material node network to an approximate USD Preview
Surface shader representation. If this option is disabled, the original
material export behavior is maintained, where viewport setting are saved
to the Preview Surface shader.

Also added the following options for texture export.

  - `Export Textures`: If converting Preview Surface, export textures
    referenced by shader nodes to a 'textures' directory which is a
    sibling of the USD file.
  - `Overwrite Textures`: Allow overwriting existing texture files when
    exporting textures (this option is off by default).
  - `Relative Texture Paths`:  Make texture asset paths relative to the
    USD.

The entry point for the new functionality is
`create_usd_preview_surface_material()`, called from
`USDAbstractWriter::ensure_usd_material()`.  The material conversion
currently handles a small subset of Blender shading nodes,
`BSDF_DIFFUSE`, `BSDF_PRINCIPLED`, `TEX_IMAGE` and `UVMAP`.

Texture export is handled by copying texture files from their original
location to a `textures` folder in the same directory as the USD.
In-memory and packed textures are saved directly to the textures folder.

This patch is based, in part, on code in Tangent Animation's USD
exporter branch.

Reviewed By: sybren, HooglyBoogly

Differential Revision: https://developer.blender.org/D13647
2022-01-27 15:51:50 +01:00
d518550c46 Fix crash on older platform due to unsupported clear command
Clearing using GPU_texture_create_2d for unorm texture needs to use
GPU_DATA_FLOAT to match the conversion requirements.
2022-01-27 15:50:38 +01:00
aa2164da33 Cleanup: Fix const correctness warning 2022-01-27 15:26:43 +01:00
5730668dea Downgrade Python zstandard module to 0.16.0
Downgrade the Python zstandard from 0.17.0 to 0.16.0. The Python package
should be linked against the exact same version of libzstd as Blender is,
otherwise it will refuse to load from within the Blender executable.

Python zstandard 0.17.0 links to 1.5.1, whereas we need 1.5.0.
2022-01-27 15:10:05 +01:00
8a20aec403 CMake/Linux/Python:copy either chardet or charset_normalizer
`chardet` was replaced by `charset_normalizer` for modern `requests`.
With this change, `{make,ninja} install` will also copy the latter into
Blender's install directory.
2022-01-27 15:10:05 +01:00
5400018106 Build: enable Python 3.10 on macOS 2022-01-27 15:03:11 +01:00
6f1ab97c53 Cleanup: Add more const correctness to some functions
These are functions that are used by eevee-rewrite which has more strict
const correctness.
2022-01-27 14:59:37 +01:00
78f29c0467 cmake/windows: Enable Python 3.10 2022-01-27 06:57:25 -07:00
0379ddac7d GPUShaderCreateInfo: Add optionnal check for optimized out resources
This opt-in functionnality enabled developper keep track of unused
resources present in the `GPUShaderCreateInfo` descriptors of their
shaders.

The output is pretty noisy at the moment so we do not enforce its usage.
2022-01-27 10:30:06 +01:00
cf31c4ba18 install_deps: Update OSL to 1.11.17.0 for llvm13 compatibility.
While install_deps tries to stay as close as possible from official
Blender versions of the libraries, it also strives to use as many distro
packages as possible.

OSL 1.11.16.0 is the minimal version that builds with llvm13, which is
the default llvm/clang version in e.g. Debian testing.
2022-01-27 09:06:50 +01:00
a99e43b2b7 install_deps: Update python and deps versions as per T93161/D13922. 2022-01-27 09:06:50 +01:00
5abab0a41a GPUShaderCreateInfo: Remove push_constant indexing
This is too much impractical and offers no real benefit.
2022-01-27 08:54:24 +01:00
a7f7b0b77e Deps builder: Python 3.10.2
Also included:

IDNA 3.2 -> 3.2
Charset Normalizer 2.0.6 -> 2.0.10
UrlLib3 1.26.7 -> 1.26.8
Requests 2.26.0 -> 2.27.1
Cython 0.29.24 -> 0.29.26
ZStandard 0.15.2 -> 0.17.0
Numpy 1.12.2 -> 1.22.0

Reviewed by: brecht
Differential Revision: https://developer.blender.org/D13922
2022-01-26 18:09:50 -07:00
1edf520439 Windows: Retire MSVC 2017 support
The lower bar for building blender
is now MSVC 2019 16.9.16.
2022-01-26 17:56:38 -07:00
0e86c60c28 Geometry Nodes: String to Curves Line/Pivot Point
Adds two new attribute outputs:
"Line" outputs the line number of the character.
"Pivot Point" outputs the selected pivot point position per char.
Some refactoring of the text layout code.

Differential Revision: https://developer.blender.org/D13694
2022-01-26 22:12:50 +01:00
bb1e2a80e4 Cleanup: Workbench: Remove extern shader strings
This is not needed anymore with the new dependency system.
2022-01-26 22:04:49 +01:00
710e46cb2d Cleanup: Move specific node tree execution functions into respective module
`node_exec` had some code that was specific to texture/shader nodes.
These functions  arent used outside there module so limit there declarations.

Also make a function static that is only used in `node_exec.c`

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D13899
2022-01-26 15:29:31 -05:00
cab1f1d9a2 Geometry Nodes: Add or improve various socket descriptions 2022-01-26 14:22:23 -06:00
7b615ca186 Cleanup: Remove RNA data from TreeElement, get via type specific class
The `TreeElement.rnaptr` was only needed for RNA tree-elements. Now it
can be gotten through the new type specific classes, e.g.
`TreeElementRNAProperty.getPointerRNA()`.
2022-01-26 19:15:57 +01:00
9dc0379dc0 Cleanup: Improve function name, introduced in own recent commit
I prefer it this way around now, especially since I'm adding a
`getPointerRNA()` too. Good to keep it match the actual struct names.
2022-01-26 19:15:57 +01:00
f6296e502a Cleanup: Small improvements to Outliner RNA path build function
Smaller cleanups to improve readability of a complex function.
2022-01-26 19:15:57 +01:00
fdd84d36ce Fix incorrect index-key in RNA path built from Outliner
Bug introduced in 7cbcfb7f49.
2022-01-26 19:15:57 +01:00
b57db4b79e Cleanup: Reduce void * reliance of new RNA C++ Outliner elements
Continuation of the previous commit, this time addressing the same for
RNA tree-elements.
2022-01-26 19:15:57 +01:00
fc0dd5583c Cleanup: Reduce void * reliance of new sequencer C++ Outliner elements
Plan is to remove things like `TreeElement.directdata` and to instead
expose specific queries in the new type specific tree-element classes.
e.g. like here: `TreeElementSequence.getSequence()`

For now uses `tree_element_cast<>()` to get the new type specific
tree-element, later these should replace `TreeElement` all together.
2022-01-26 19:15:57 +01:00
08e2885796 Outliner: Function to "cast" C-style TreeElement to typed C++ pendant
Add function to safely request the type-specific C++ element from a
C-style `TreeElement`. Looks like this:
```
TreeElementFoo *te_foo = tree_element_cast<TreeElementFoo>(te);
```
The "cast" will return null if the tree-element doesn't match the
requested type.

This is useful for the transition from the C-style type to the new ones.
2022-01-26 19:15:57 +01:00
da1b6c4c02 Outliner: Port sequencer elements to new tree-element design
Continuation of work started in 2e221de4ce and 249e4df110.

Adds new tree-element classes for sequences, strips and strip
duplicates.
2022-01-26 19:15:57 +01:00
d74c2b5c1f Outliner: Add missing sanity checks for RNA tree-elements
Forgot to add these in 9bce134e56. Also tweaked assert to print a
message that was previously communicated via a comment only.
2022-01-26 19:15:57 +01:00
57dfec79f4 DRW: Fix builtin uniform name mismatch
This lead to severe unreported regression, like volume rendering broken
in workbench.
2022-01-26 19:09:05 +01:00
13f2df3c28 Fix/workaround failing Cycles tests on macOS after ray offset changes
Temporarily blacklist a few tests with overlapping objects as they seem to
give different results on this platform.
2022-01-26 18:52:56 +01:00
489b484b7b Cleanup: GPUShaderShared: Complete vector support
Move some declaration from `GPU_shader_shared.h` to the main
common file and add missing vector declarations.
2022-01-26 18:10:59 +01:00
b42adab3a2 GPUShader: Add GLSL source modification pass to support enums
This uses a light parser / string modification pass to convert
C++ enum declaration syntax to GLSL compatible one.

GLSL having no support for enums, we are forced to convert the
enum values to a series of constant uints.

The parser (not really one by the way), being stupidly simple,
will not change anything to the values and thus make some C++
syntax (like omitting the values) not work.

The string replacement happens on all GLSL files on startup.
I did not measure significant changes in blender startup speed.
There is plans to do all of this at compile time.

We limit the scope of the search to `.h` and `.hh` files to prevent
confusing syntax in `.glsl` files.

There is basic error reporting with file, line and char logging
for easy debuggabiliy.

The requirements to use this enum sharing system are already listed in
`gpu_shader_shared_utils.h` and repeated on top of the preprocessor
function.
2022-01-26 18:10:59 +01:00
e729abb0e2 BLI_string_ref: Add back missing rfind()
Must have been removed in a bad merge or something.
2022-01-26 18:10:59 +01:00
William Leeson
74afc86d4b Cycles: remove ray offsetting
Remove small ray offsets that were used to avoid self intersection, and leave
that to the newly added primitive object/prim comparison. These changes together
significantly reduce artifacts on small, large or far away objects.

The balance here is that overlapping primitives are not handled well and should
be avoided (though this was already an issue). The upside is that this is
something a user has control over, whereas the other artifacts had no good
manual solution in many cases.

There is a known issue where the Blender particle system generates overlapping
objects and in turn leads to render differences between CPU and GPU. This will
be addressed separately.

Differential Revision: https://developer.blender.org/D12954
2022-01-26 17:51:05 +01:00
William Leeson
ae44070341 Cycles: explicitly skip self-intersection
Remember the last intersected primitive and skip any intersections with the
same primitive.

Ref D12954
2022-01-26 17:51:05 +01:00
William Leeson
a9bb460766 Cycles: compute triangle location from barycentric instead of re-intersecting
This is a bit more efficient than what we did before.

Ref D12954
2022-01-26 17:51:05 +01:00
974981a637 Fix T95222: Crash selecting vertices with modifier applied on cage
Caused by 0f89bcdbeb where it was needed for cage and evaluated mesh
to have same behavior in respect of having edit_mesh pointer assigned.
This change makes it so that edit_data is not implied to exist when the
edit_mesh pointer is not null. This was already the case in some other
code.
2022-01-26 17:48:45 +01:00
79927e730e LibOverride: Resync: Do not process overrides that should already have been resynced.
Those cases are almost always synptoms of either bug in code, or broken
files. Re-doin resync on them only costs time and causes extra trash
data as a result, without really helping in any way.
2022-01-26 16:20:08 +01:00
990ed109f2 Fix (unreported) missing 'override-exclusion' flag on new RNA mesh data accessors.
Both new normals (from rBb7fe27314b25) and vpaint (from rBf7bbc7cdbb6c)
RNA arrays were missing the `PROPOVERRIDE_IGNORE`. Those huge blobs of
geometry data should never be processed by liboverride code.
2022-01-26 16:20:08 +01:00
37848d1c8e Assets: enable node group assets
This enables support for node group assets. Previously, node group
assets only worked when the "extended asset browser" experimental
features is enabled.

Differential Revision: https://developer.blender.org/D13748
2022-01-26 15:22:15 +01:00
12b26d21b0 Assets: allow creating preview image by rendering active object
For node groups there is no good default preview generation.
Nevertheless, t would be useful to generate a preview image for a
node group by rendering an object in some cases.

This commit adds a new operator that allows updating the preview
image for the active asset by rendering the active object.
Note, the operator can also be used for other asset types, not just
node groups.

The operator can be found in a menu right below the refresh-preview
button. Currently it is the only operator in that menu. In the future,
more operators to create previews may be added.

Differential Revision: https://developer.blender.org/D13747
2022-01-26 15:10:49 +01:00
6738ecb64e Fix T94900: Fix drawing artifacts sequencer+node editor.
The VSE and node editor only uses an overlay buffer to draw to the screen. The
GPUViewport assumes that platforms clears all textures during creation, but
they do not on selected platforms. What would lead to drawing from
uncleared memory.

This patch fixes this by clearing all viewport textures during creation.
2022-01-26 14:48:28 +01:00
5b299e5999 D13910: Workbench: Port shaders to use GPUShaderCreateInfo
Also adds a few things to GPUShader for easily create shaders.
Heavy usage of macros to compose the createInfo and avoid
duplications and copy paste bugs.
This makes the link between the shader request functions
(in workbench_shader.cc) and the actual createInfo a bit
obscure since the names are composed and not searchable.

Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D13910
2022-01-26 12:46:37 +01:00
9bce134e56 Outliner: Port RNA elements to new tree-element design
Continuation of work started in 2e221de4ce and 249e4df110.

Adds new tree-element classes for RNA structs, properties and array
elements. This isn't exactly a copy and paste, even though logic should
effectively be the same. Further cleanups are included to share code in
a nice way, improve code with simple C++ features, etc.
2022-01-26 11:44:58 +01:00
1bf6a880ab ID: Fix failing test cases.
This fixes failing test cases when using `make test`.
See {D13615} for more information.

The fix will perform the id remapping one item at a time. Although not
really nice, this isn't a bottleneck.

The failing test cases is because space_node stores pointers multiple
times and didn't update all pointers. It was not clear why it didn't do
it, but changing the behavior more to the previous behavior fixes the
issue at hand.

I prefer to remove the double storage of the node tree pointers (in
snode and path) to reduce pointer management complexity.
2022-01-26 11:12:52 +01:00
Jeroen Bakker
a21bca0e20 Performance: Remap multiple items in UI
During sprite fright loading of complex scenes would spend a long time in remapping ID's
The remapping process is done on a per ID instance that resulted in a very time consuming
process that goes over every possible ID reference to find out if it needs to be updated.

If there are N of references to ID blocks and there are M ID blocks that needed to be remapped
it would take N*M checks. These checks are scattered around the place and memory.
Each reference would only be updated at most once, but most of the time no update is needed at all.

Idea: By grouping the changes together will reduce the number of checks resulting in improved performance.
This would only require N checks. Additional benefits is improved data locality as data is only loaded once
in the L2 cache.

It has be implemented for the resyncing process and UI editors.
On an Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz 16Gig the resyncing process went
from 170 seconds to 145 seconds (during hotspot recording).

After this patch has been applied we could add similar approach
to references (references between data blocks) and functionality (tagged deletion).
In my understanding this could reduce the resyncing process to less than a second.
Opening the village production file between 10 and 20 seconds.

Flame graphs showing that UI remapping isn't visible anymore (`WM_main_remap_editor_id_reference`)
* Master {F12769210 size=full}
* This patch {F12769211 size=full}

Reviewed By: mont29

Maniphest Tasks: T94185

Differential Revision: https://developer.blender.org/D13615
2022-01-26 11:12:35 +01:00
b3bf46b78d Revert "CMake: include BROTLI_LIBRARIES in FREETYPE_LIBRARIES on UNIX"
This reverts commit 086f191169.

There was apparently a problem using APPEND which wasn't referenced
in the commit log.

Added comment noting the reason for the discrepancy.
2022-01-26 20:51:04 +11:00
0cb5eae9d0 Gizmo: optimize intersection tests, fix selection bias
Use more efficient logic for detecting when gizmos are under the cursor.
Even though this isn't a bottleneck, it runs on cursor motion in the
3D viewport, so avoiding any lag here is beneficial.

The common case for cursor motion without any gizmos was always
drawing two passes (one small, then again if nothing was found).

Now a single draw call at the larger size is used.

In isolation this gives around 1.2x-1.4x speedup.

When there are multiple gizmos a depth-buffer picking is used
(similar to object / bone selection) which is more involved but
still only performs 2x draw calls since the result is cached for reuse.

See note in gizmo_find_intersected_3d for a more detailed explanation.

Also restore the depth values in the selection result as they're
needed for gizmos to use selection bias.
Broken since support for GL_SELECT was removed.
2022-01-26 17:24:21 +11:00
1758dcd423 Fix T94794: Gizmo selection doesn't pick the front-most gizmo
Early on in 2.8x development gizmo-depth used GL_SELECT,
which has been removed. Bind the depth buffer so occlusion queries
use the front-most gizmo.

While this report only mentions face-maps, gizmo depth was ignored in
all cases. This wasn't noticeable in most cases though since the
transform gizmo for example was placed so gizmos didn't overlap.
2022-01-26 17:21:10 +11:00
9338126ecc Fix error using GPU selection cache for selection picking
When calling GPU_select_cache_begin, checking the selection mode used
the last used selection mode, not the one about to be used.

Using border select, then picking would not use the selection cache.

This wasn't noticeable by users as failing to use cache just completes
the selection without it (drawing the depth buffer unnecessarily).
2022-01-26 17:21:10 +11:00
46ae083113 Fix: OSL not recognizing UVTILE images
The OSL image compilation step needed to be taught about the new UVTILE
format for UDIM textures.

A small missing feature from OIIO[1] means this is a bit uglier than it
needs to be. Once we update to a version of OIIO with the fix we can
remove the string replace part.

[1] 35cb6a83e2

Differential Revision: https://developer.blender.org/D13912
2022-01-25 22:00:23 -08:00
b06fff4737 Cleanup: spelling in comments 2022-01-26 16:06:22 +11:00
94d2a611ec Cleanup: unused variable warning, formatting 2022-01-26 16:01:34 +11:00
37e555d2fe CMake: mark all BROTLI libraries as advanced 2022-01-26 16:01:00 +11:00
086f191169 CMake: include BROTLI_LIBRARIES in FREETYPE_LIBRARIES on UNIX
This was already done for APPLE & WIN32, which would
reference these libraries twice.

Now append BROTLI_LIBRARIES to FREETYPE_LIBRARIES when they're
required for linking.

No functional changes as all references to FREETYPE_LIBRARIES also
used BROTLI_LIBRARIES.
2022-01-26 16:00:55 +11:00
4c951bfa82 CMake: add WITH_SYSTEM_FREETYPE to link against the systems freetype 2022-01-26 15:31:30 +11:00
4530449317 CMake: resolve issues using pre-compiled & system libraries for Unix
When LIBDIR existed, searching for system libraries would always
first search 'LIBDIR'.

This meant "WITH_SYSTEM_*" would still prefer LIBDIR versions of
libraries if they exist.

The presence of LIBDIR also ignored the setting for WITH_STATIC_LIBS
which is now restored to the cached value once pre-compiled libraries
have been handled.
2022-01-26 15:20:32 +11:00
c4bedeb018 GLShader: Fix crash caused by redundant uniform declaration
This slipped through during a rebase.
2022-01-26 00:03:27 +01:00
83094d9a0d Fix T94149: Incorrect sound strip length
Fix formula in function `SEQ_sound_update_length`.

Formula for sound strip length was changed in commit ded68fb102, when
strip is added to timeline, but it was not changed in function
mentioned above.
2022-01-25 23:59:50 +01:00
c1b5cea63a Cleanup: Remove useless comments 2022-01-25 16:54:36 -06:00
b45e71e22c VSE: Build proxies only for slow movies
This change applies only for automatic proxy building, when strip
is added to timeline. Manual building process is not affected.

Don't build proxy file if movie is already fast enough to seek.
To determine seek performance, check if whole GOP can be decoded
in 100 milliseconds.

To consider some variation in GOP size, large number of packets are
read, assuming that each packet will produce 1 frame. While this is not
technically correct, it does give quite accurate estimate of maximum GOP
size.

This test will ensure consistent performance on wide array of machines.
Check should be done in order of few milliseconds.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11671
2022-01-25 22:06:46 +01:00
597eaeaa11 Deps builder: add VS2019, remove 2013/2015 support
This will allow building most deps with VS2019
SDL has some linker issues that are resolved in
a newer version, but that would be better handled
in a separate change.

VS2013 and VS2015 support which was broken has
been removed.
2022-01-25 13:55:18 -07:00
52b2769b9c Fix T95169: Assert in weld modifier code
Return early before accessing the array when all edges are merged.
2022-01-25 13:56:00 -06:00
c847122096 Cleanup: Remove leftover hair fade code in Cycles
Missed in rB1687903fb813f6656453fbc7c49237b06437370c
2022-01-25 14:14:39 -05:00
1687903fb8 Cleanup: Remove leftover hair fade code in Cycles. 2022-01-25 19:46:10 +01:00
c89d6b0953 Workbench: Use GPU_ARB_gpu_shader5 instead of GL variant
This is to be able to turn off the extension usage on demand.
2022-01-25 18:51:31 +01:00
2637f94358 GLShader: Fix buffer overflow caused by workaround uniform
In order to use a workaround builtin uniform, we need to count it
just like other uniforms and give it some space in the name buffer.

This also fixes extensions being added after the uniform declaration.
All `#extension` directives are now part of the gl backend.
2022-01-25 18:48:58 +01:00
3e2591c83e Cleanup: Remove unused variable
Mistake in a18bd403bf
2022-01-25 11:08:34 -06:00
0ec94d5359 Geometry Nodes: Port weld modifier to the merge by distance node
This commit moves the weld modifier code to the geometry module
so that it can be used in the "Merge by Distance" geometry node
from ec1b0c2014. The "All" mode is exposed in the node
for now, though we could expose the "Connected" mode in the future.

The modifier itself is responsible for creating the selections from
the vertex group. The "All" mode takes an `IndexMask` for the
selection, and the "Connected" mode takes a boolean array,
since it actually iterates over all edges.

Some disabled code for a BVH mode has not been copied over,
it's still accessible through the patches and git history anyway,
and it made the port slightly simpler.

Differential Revision: https://developer.blender.org/D13907
2022-01-25 11:07:31 -06:00
932d8dba52 Point Cloud: expose in Python API for release, now that Cycles uses it
Previously it was only part of experimental features in beta, however now
renderers can render point clouds generated by geometry nodes. Adding or
converting a point cloud object directly is still hidden by default, since
there is no good way to edit it.
2022-01-25 18:03:52 +01:00
ec1b0c2014 Geometry Nodes: Initial merge by distance node
This implements a merge by distance operation for point clouds.
Besides the geometry input, there are two others-- a selection
input to limit the operation to certain points, and the merge
distance. While it would be a reasonable feature, the distance
does not support a field currently, since that would make
the algorithm significantly more complex.

All attributes are merged to the merged points, with the values
mixed together. This same generic method is used for all attributes,
including `position`. The `id` attribute uses the value from the
first merged index for each point.

For the implementation, most of the effort goes into creating a
merge map to speed up attribute mixing. Some parts are inherently
single-threaded, like finding the final indices accounting for the
merged points. By far most of the time is spend balancing the
KD tree.

Mesh support will be added in the next commit.

Differential Revision: https://developer.blender.org/D13649
2022-01-25 10:51:52 -06:00
97a023a0d5 Cycles: Reorganize Acceleration Structure UI panel.
Only show options that are valid for the used device (CPU, GPU, Multi).

Note: The panel isn't shown for OPTIX anymore, unless Multi device is used.

Reference: https://developer.blender.org/D13592
2022-01-25 17:33:41 +01:00
e2a36a6e45 Cycles: Make Embree compact BVH optional
Make the Embree RTC_SCENE_FLAG_COMPACT flag optional and enabled per default.
Disabling it makes CPU rendering a bit faster in some scenes at the cost of a higher memory usage.

Barbershop renders about 3% faster, victor about 4% on CPU with compact BVH disabled.

Differential Revision: https://developer.blender.org/D13592
2022-01-25 17:22:08 +01:00
f26c36c96b make.bat: unify python detection
Several sub commands tried on their own
to locate python, given I wanted to look
in several locations for a broader libdir
compatibility this is best done in a
central location.

Python 3.9 is still preferred, but if
3.10-3.12 are available that be accepted
as well.

note: this is about the python version
make.bat uses to run various python helper
scripts, this change has no influence on
the python version blender itself uses.
2022-01-25 09:19:03 -07:00
c813a1b358 Cycles: add Point Info node
With (center) position, radius and random value outputs.

Eevee does not yet support rendering point clouds, but an untested
implementation of this node was added for when it does.

Ref T92573
2022-01-25 17:14:20 +01:00
eab066cbf2 VSE: Use timecodes by default
Movies with variable frame rate can cause mismatch of displayed frame
when proxies are used. Since proxies are not used for rendering, this
means, that output may be different than expected. This problem can be
avoided when timecodes are used.

Set used timecode to Record Run. Timecodes are built with proxies at
the same time, therefore if proxies are built and used this will
resolve possible mismatch of output.

Record run is chosen, because it will show frames based on time they
were encoded by encoder and should match behavior as if movie was
played back at normal speed. This change is done only for new strips
in order to not overwrite user defined settings.

Other minor changes:
- When proxies are enabled, size 25% is no longer set by default. It was mostly annoying anyway.
- Silence warning when timecode file is not present. This was introduced in 4adbe31e2f.
  Previously use of timecodes was hard-coded in sequencer and this error would spam console if timecodes would be
  enabled by default and proxies would be never built.

ref: T95093

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D13905
2022-01-25 17:07:11 +01:00
Michael
2ed73fc97e Fix T94237: Glitch when copying unaligned ffmpeg buffer
Using a negative linesize to flip an image vertically is supported in
ffmpeg but not for every function.

This method treats frames that need and those that do not need alignment
the same. An RGBA frame buffer with alignment that ffmpeg decides is
optimal for the CPU and build options is allocated by ffmpeg.
The `sws_scale` does the colorspace transformation into this RGBA frame
buffer without flipping. Now the image is upside down and aligned.
The combined unaligning and vertical flipping is then done by
`av_image_copy_to_buffer` which seems to handle negative linesize
correctly.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D13908
2022-01-25 17:07:11 +01:00
a18bd403bf Nodes: Improve link-drag search support for boolean math node
List the operations in the search instead of the "Boolean" socket names.
2022-01-25 09:51:20 -06:00
96667e3391 Fix T93058: Crash on opening old pre-2.80 .blend files.
Layer resync code would not yet fully properly deal with all possible
invalid status of ViewLayer comming from those older files.

Now put 2.80-doversion specific fixes into their own dedicated
function, so that they do not affect actual regular layer resync code
anymore. Also added some sanity-checks in main
`BKE_layer_collection_sync` code.
2022-01-25 16:44:55 +01:00
6c25aabddf GLShader: Fix fallback to gl_BaseInstance
All `#entension` directives needs to be first before any other
token. Add missing `;` after uniform declaration.
2022-01-25 16:23:54 +01:00
0477ca75f0 CMake/Linux: only link to brotli when using static precompiled libraries
The Brotli library only needs to be explicitly linked when using the
statically linked libraries. When using system libs they're shared, and
the .so loading mechanism takes care of dependencies.
2022-01-25 16:18:59 +01:00
Hallam Roberts
14f6afb090 Geometry Nodes: Expand the Boolean Math node
Currently the Boolean Math node only has 3 basic logic gates:
AND, OR, and NOT. This commit adds 6 additional logic gates
for convenience and ease of use.

- **Not And (NAND)** returns true when at least one input is false.
- **Nor (NOR)** returns true when both inputs are false.
- **Equal (XNOR)** returns true when both inputs are equal.
- **Not Equal (XOR)** returns true when both inputs are different.
- **Imply (IMPLY)** returns true unless the first input is true and
  the second is false.
- **Subtract (NIMPLY)** returns true when the first input is true and
  the second is false.

Differential Revision: https://developer.blender.org/D13774
2022-01-25 09:09:39 -06:00
368bfa80f9 Fix: Build issue with MSVC + Python 3.10
ssize_t is a posix type pyconfig.h previously
supplied for MSVC, it appears to have stopped
doing this in the python 3.10 headers.

Py_ssize_t is the type of the field this macro
actually returns, so best to to use that in our
code as well.
2022-01-25 07:54:28 -07:00
460e0a1347 Revert "Performance: Remap multiple items in UI"
This reverts commit 948211679f.
This commit introduced some regressions in the test suite.
As this change is a core part of blender Bastien and I decided to revert
it as the solution isn't clear and needs more investigation.

The following tests FAILED:
	 62 - blendfile_liblink (SEGFAULT)
	 63 - blendfile_library_overrides (SEGFAULT)

It fails in (id_us_ensure_real)
2022-01-25 15:31:46 +01:00
33ba298b5d GPUShader: Add optionnal single shader stage interface for in and out
This makes optionnal the use of a different interface for the geometry
shader stage output. When the vertex and geometry interface instance name
matches, a `_in` and `_out` suffix is added to the end of the instance name.

This makes it easier to have optional geometry shader stages.

# Conflicts:
#	source/blender/gpu/intern/gpu_shader_create_info.hh
2022-01-25 15:08:11 +01:00
Jeroen Bakker
948211679f Performance: Remap multiple items in UI
During sprite fright loading of complex scenes would spend a long time in remapping ID's
The remapping process is done on a per ID instance that resulted in a very time consuming
process that goes over every possible ID reference to find out if it needs to be updated.

If there are N of references to ID blocks and there are M ID blocks that needed to be remapped
it would take N*M checks. These checks are scattered around the place and memory.
Each reference would only be updated at most once, but most of the time no update is needed at all.

Idea: By grouping the changes together will reduce the number of checks resulting in improved performance.
This would only require N checks. Additional benefits is improved data locality as data is only loaded once
in the L2 cache.

It has be implemented for the resyncing process and UI editors.
On an Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz 16Gig the resyncing process went
from 170 seconds to 145 seconds (during hotspot recording).

After this patch has been applied we could add similar approach
to references (references between data blocks) and functionality (tagged deletion).
In my understanding this could reduce the resyncing process to less than a second.
Opening the village production file between 10 and 20 seconds.

Flame graphs showing that UI remapping isn't visible anymore (`WM_main_remap_editor_id_reference`)
* Master {F12769210 size=full}
* This patch {F12769211 size=full}

Reviewed By: mont29

Maniphest Tasks: T94185

Differential Revision: https://developer.blender.org/D13615
2022-01-25 14:51:44 +01:00
Jeroen Bakker
3f42417cd4 Draw: Migrate hair refine compute shader to use create info.
This patch migrates the draw manager hair refine compute shader to use
GPUShaderCreateInfo.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D13915
2022-01-25 14:46:45 +01:00
196da819ba Python: Expose crazyspace correction functionality via RNA
Allows to perform correction of coordinate delta/displacement in a
similar way of how sculpt mode handles sculpting on a deformed mesh.
An example of usecase of this is allowing riggers and sciprters to
improve corrective shapekey workflow.

The usage consists of pre-processing and access. For example:

  object.crazyspace_eval(depsgraph, scene)

  # When we have a difference between two vertices and want to convert
  # it to a space to be stored, say, in shapekey:
  delta_in_orig_space = rigged_ob.crazyspace_displacement_to_original(
      vertex_index=i, displacement=delta)

  # The reverse of above.
  delta_in_deformed_space = rigged_ob.crazyspace_displacement_to_deformed(
      vertex_index=i, displacement=delta)

  object.crazyspace_eval_clear()

Fuller explanation with actual usecases and studio examples are written in
the comment:

  https://developer.blender.org/D13892#368898

Differential Revision: https://developer.blender.org/D13892
2022-01-25 14:43:44 +01:00
31296f6f9d CMake/Linux: Fix Brotli library finding on standard distros.
Brotli seems to add a custom postfix to its static libraries by default,
but in Debian at least libraries are just named the same for both shared
and static versions, as usual.

So add standard name after static-specific ones.

Follow-up to rB4c617c06e9cb and rBa000de7c2a4d.
2022-01-25 14:34:33 +01:00
0f89bcdbeb Fix depsgraphs sharing IDs via evaluated edit mesh
The evaluated mesh is a result of evaluated modifiers, and referencing
other evaluated IDs such as materials.
It can not be stored in the EditMesh structure which is intended to be
re-used by many areas. Such sharing was causing ownership errors causing
bugs like

  T93855: Cycles crash with edit mode and simultaneous viewport and final render

The proposed solution is to store the evaluated edit mesh and its cage in
the object's runtime field. The motivation goes as following:

- It allows to avoid ownership problems like the ones in the linked report.
- Object level is chosen over mesh level is because the evaluated mesh
  is affected by modifiers, which are on the object level.

This patch allows to have modifier stack of an object which shares mesh with
an object which is in edit mode to be properly taken into account (before
the change the modifier stack from the active object will be used for all
objects which share the mesh).

There is a change in the way how copy-on-write is handled in the edit mode to
allow proper state update when changing active scene (or having two windows
with different scenes). Previously, the copt-on-write would have been ignored
by skipping tagging CoW component. Now it is ignored from within the CoW
operation callback. This allows to update edit pointers for objects which are
not from the current depsgraph and where the edit_mesh was never assigned in
the case when the depsgraph was evaluated prior the active depsgraph.

There is no user level changes changes expected with the CoW handling changes:
should not affect on neither performance, nor memory consumption.

Tested scenarios:

- Various modifiers configurations of objects sharing mesh and be part of the
  same scene.

- Steps from the reports: T93855, T82952, T77359

This also fixes T76609, T72733 and perhaps other reports.

Differential Revision: https://developer.blender.org/D13824
2022-01-25 14:32:23 +01:00
c5980ada4f GPU: Add GPU_shader_create_from_info_name
This function will be used as the way to build shaders from
create_infos. The previous used method was using a private function.
2022-01-25 14:22:44 +01:00
Kevin C. Burke
17b0c06946 Animation: Equalize Handle Operator
The Equalize Handles operator allows users to make selected handle
lengths uniform: either respecting their original angle from the key
control point or by flattening their angle (removing the overshoot
sometimes produced by certain handle types).

Design: T94172

Reviewed by: sybren

Differential Revision: https://developer.blender.org/D13702
2022-01-25 11:41:40 +01:00
a000de7c2a CMake/Linux: find Brotli library the proper way
Use a `FindBrotli.cmake` module instead of manually appending library
paths.

This is just for Linux; Windows and macOS will be reviewed separately.
2022-01-25 11:34:13 +01:00
a54142f3f1 Cleanup: Replace reinterp cast with static cast.
Conversion of void* should not use the unsafe reinterp cast.
2022-01-25 10:18:32 +01:00
1b1693d43f Fix (unreported) RNA setter for TextEditor's text ID pointer not ensuring real user. 2022-01-25 09:12:13 +01:00
2e9b8689e4 Fix T95037: Allow making local IDs that are not used by anything.
Some IDs (like text ones) can be linked and only kept around thanks to
editors, allow making such IDs local in `BKE_lib_id_make_local_generic`.

Also refactor logic checking whether ID should be made directly local or
copied into its own util function, so that we can remain sure all
special-cases 'make local' code still uses the same logic here.
2022-01-25 09:12:13 +01:00
a2301b1d91 Geometry Nodes: Add description to curve handle input node
The "Relative" input isn't immediately obvious unless one is familar
with that naming pattern, so an explicit description may be helpful.
2022-01-25 00:04:33 -06:00
114b06b3cb Cleanup: Remove unused pixel buffer in read_render_tile
A left over remnant from rB1a134c4c30a643ada1b9a7a037040b5f5c173a28

Differential Revision: https://developer.blender.org/D13901
2022-01-24 20:53:19 -08:00
2bf519d211 Cleanup: Correct location of node function declarations
Currently there are many function declarations in `BKE_node.h` that
don't actually have implementations in blenkernel. This commit moves
the declarations to `NOD_composite.h`, `NOD_texture.h`, and
`NOD_shader.h` instead. This helps to clarify the purpose of the
different modules.

Differential Revision: https://developer.blender.org/D13869
2022-01-24 16:18:30 -06:00
4d799db72f LShaderInterface: Fix interface binding with UBO containing arrays
To avoid the issue we search using the name in the `name_buffer_` which
already have the array suffix stripped out.
2022-01-24 21:25:53 +01:00
5a0c5912a4 Tests: Enable new tests for geometry nodes extrude node
rB95981c9876483256b28
2022-01-24 13:55:32 -06:00
083de503ce GLShaderInterface: Fix interface from createInfo not setting bindings
This is because the `glUniform1i` calls were not preceeded by `glUseProgram`
which made parameters not stick.
2022-01-24 20:26:33 +01:00
04c3b08518 Fix T94355: Cycles wrong GPU bake with adaptive sampling 2022-01-24 19:18:11 +01:00
263f862ba5 Add workaround for broken interface query functions on Intel HD Graphics 4400 and 4600
Fixes T93680

For current drivers of Intel HD Graphics 4400 and 4600, various Program Introspection functions appear broken and return incorrect values, causing crashes in the current handling of SSBOs. Disable use of this feature on those devices. Add checks to features that use SSBOs (Hair and Subdivision Modifier).

Reviewed By: fclem, jbakker

Maniphest Tasks: T93680

Differential Revision: https://developer.blender.org/D13806
2022-01-24 18:48:16 +01:00
e2337b5342 GPU subdiv: reduce memory usage for point IBO
The point IBO should only have data for coarse vertices (or in general,
the vertices in the original mesh). As it used for displaying the
vertices for selection in edit mode, and as it indexes into the VBOs for
the positions and edit data, it is itself only indexed by coarse/
original vertex index.

For the subdivision case, this would allocate space for the final
subdivision vertex and reallocate to make room for loose geometry,
although only the first coarse vertex count amount of data would be.

Now just allocate for the required memory. Also reuse index buffer APIs
instead of doing manual work.
2022-01-24 18:42:37 +01:00
90d61600fc GPU subdiv: fix unitialized data 2022-01-24 18:27:05 +01:00
Jens Ehrhardt
e673cfc2d7 Fix T95099: Have launcher wait for Blender exit
unity launches blender in background mode to do some
file conversions, ever since the launcher got introduced
this process broke.

The root cause here is: Unity looks up the default program
to launch .blend files with, which is now the launcher, then
launches it in background mode with a script to export the data.

The launcher however was designed to exit as quickly as
possible so there would not be an extra background process
lingering. It does not wait for blender to exit and does not
pass back any error codes.

This broke unity's workflow since it assumed if the process
exits and succeeds the data *must* be ready for reading which
no longer holds true.

This change keeps the launcher design as was previously,
*except* when launching in background mode, then it
waits and passes back any error codes, thus restoring
unity's workflow.

Differential Revision: https://developer.blender.org/D13894
Reviewed by: LazyDodo, Brecht
2022-01-24 08:43:38 -07:00
25fa5792e6 Cleanup: Move the "toggle smooth brush" functionality to functions
This is so it will be easier to keep the logic to toggle on/off in sync
because they are declared close to eachother.
2022-01-24 16:00:01 +01:00
a215d7e230 Hook up invert and smooth mode to weight and vertex paint
Previously weight paint wasn't hooked up to the "Smooth" and "Invert" modes.
With this patch it is not possible to use the "Smooth" and "Invert"
modifiers for the draw keybindings.

Reviewed By: Campbell Barton

Differential Revision: http://developer.blender.org/D13857
2022-01-24 16:00:01 +01:00
0928fe8710 Fix T94651: Cycles error with pointcloud vector attribute 2022-01-24 15:58:32 +01:00
4c617c06e9 Linux/CMake: link libbbrotli*.a along with new FreeType
Add `libbrotlidec-static.a` and `libbrotlicommon-static.a` to the CMake
`$FREETYPE_LIBRARIES` variable; they'll be required when the Linux libs
for the FreeType upgrade lands (D13448).

The order of libraries is different compared to the similar lines in the
Windows and Apple CMake files, to prevent linker errors on Linux.
2022-01-24 15:44:03 +01:00
796ef560b4 Fix Image.gl_touch not loading image.
Same fix as for {rBc09f61a9157ddee0e186db52fb7ac0f4cdae09da}
2022-01-24 15:32:04 +01:00
578baf95e0 Cleanup: Remove unused enum
The `SCULPT_TRANSFORM_DISPLACEMENT_INCREMENTAL` value is not actually
being used.

Keeping it in the code only complicates its readability.
2022-01-24 10:18:34 -03:00
e774f2c901 GPUShaderCreateInfo: Add manual validation of bindpoints
Some drivers/glsl compilers will not warn about multiple resources using
the same binding, creating silent errors.

This patch checks for this case and outputs a descriptive error message if
a particular createInfo merge error is founds.

Other validation can be added later.
2022-01-24 13:28:33 +01:00
7708a848c9 Cleanup: sort cmake file lists 2022-01-24 21:23:30 +11:00
4b1f243e4d Cleanup: sort struct forward declarations 2022-01-24 21:16:06 +11:00
f9b6a257bd Cleanup: clang-format 2022-01-24 21:15:25 +11:00
95981c9876 Geometry Nodes: Extrude Mesh Node
This patch introduces an extrude node with three modes. The vertex mode
is quite simple, and just attaches new edges to the selected vertices.
The edge mode attaches new faces to the selected edges. The faces mode
extrudes patches of selected faces, or each selected face individually,
depending on the "Individual" boolean input.

The default value of the "Offset" input is the mesh's normals, which
can be scaled with the "Offset Scale" input.

**Attribute Propagation**
Attributes are transferred to the new elements with specific rules.
Attributes will never change domains for interpolations. Generally
boolean attributes are propagated with "or", meaning any connected
"true" value that is mixed in for other types will cause the new value
to be "true" as well. The `"id"` attribute does not have any special
handling currently.

Vertex Mode
 - Vertex: Copied values of selected vertices.
 - Edge: Averaged values of selected edges. For booleans, edges are
   selected if any connected edges are selected.
Edge Mode
 - Vertex: Copied values of extruded vertices.
 - Connecting edges (vertical): Average values of connected extruded
   edges. For booleans, the edges are selected if any connected
   extruded edges are selected.
 - Duplicate edges: Copied values of selected edges.
 - Face: Averaged values of all faces connected to the selected edge.
   For booleans, faces are selected if any connected original faces
   are selected.
 - Corner: Averaged values of corresponding corners in all faces
   connected to selected edges. For booleans, corners are selected
   if one of those corners are selected.
Face Mode
 - Vertex: Copied values of extruded vertices.
 - Connecting edges (vertical): Average values of connected selected
   edges, not including the edges "on top" of extruded regions.
   For booleans, edges are selected when any connected extruded edges
   were selected.
 - Duplicate edges: Copied values of extruded edges.
 - Face: Copied values of the corresponding selected faces.
 - Corner: Copied values of corresponding corners in selected faces.
Individual Face Mode
 - Vertex: Copied values of extruded vertices.
 - Connecting edges (vertical): Average values of the two neighboring
   edges on each extruded face. For booleans, edges are selected
   when at least one neighbor on the extruded face was selected.
 - Duplicate edges: Copied values of extruded edges.
 - Face: Copied values of the corresponding selected faces.
 - Corner: Copied values of corresponding corners in selected faces.

**Differences from edit mode**
In face mode (non-individual), the behavior can be different than the
extrude tools in edit mode-- this node doesn't handle keeping the back-
faces around in the cases that the edit mode tools do. The planned
"Solidify" node will handle that use case instead. Keeping this node
simpler and faster is preferable at this point, especially because that
sort of "smart" behavior is not that predictable and makes less sense
in a procedural context.

In the future, an "Even Offset" option could be added to this node
hopefully fairly simply. For now it is left out in order to keep
the patch simpler.

**Implementation**
For the implementation, the `Mesh` data structure is used directly
rather than converting to `BMesh` and back like D12224. This optimizes
for large extrusion operations rather than many sequential extrusions.
While this is potentially more verbose, it has some important benefits:
First, there is no conversion to and from `BMesh`. The code only has
to fill arrays and it can do that all at once, making each component of
the algorithm much easier to optimize. It also makes the attribute
interpolation more explicit, and likely faster. Only limited topology
maps must be created in most cases.

While there are some necessary loops and allocations with the size of
the entire mesh, I tried to keep everything I could on the order of the
size of the selection rather than the size of the mesh. In that respect,
the individual faces mode is the best, since there is no topology
information necessary, and the amount of work just depends on the size
of the selection.

Modifying an existing mesh instead of generating a new one was a bit
of a toss-up, but has a few potential benefits:
 - Avoids manually copying over attribute data for original elements.
 - Avoids some overhead of creating a new mesh.
 - Can potentially take advantage of future ammortized mesh growth.
This could be changed easily if it turns out to be the wrong choice.

Differential Revision: https://developer.blender.org/D13709
2022-01-23 22:42:49 -06:00
46475b8e11 Cleanup: Grammar: its self vs. itself 2022-01-23 22:34:56 -06:00
43e3a33082 Cleanup: spelling in comments 2022-01-24 14:35:23 +11:00
c69a581c0b Cleanup: avoid positional struct initialization
When moving to C++ field for initialization was removed.
Favor assignments to field names as it reads better and avoids bugs if
files are ever re-arranged as well as mistakes (see T94784).

Note that the generated optimized output is identical with GCC11.
2022-01-24 14:27:16 +11:00
abf30007ab Geometry Nodes: Triangulate Node - Add Selection Input
This adds a selection field input to the node, faces that are selected and
meet the minimum vertex count threshold will be triangulated.

Differential Revision: https://developer.blender.org/D13804
2022-01-23 13:27:53 -06:00
38c7378949 Geometry Nodes: Relative Handle Position Mode
Add a boolean option to have the Curve Handle Position input node return the
position of the handle relative to each point position.

Differential Revision: https://developer.blender.org/D12947
2022-01-23 12:29:37 -06:00
807c58aae4 Cleanup: separate function for Alembic edge crease reading 2022-01-23 16:35:11 +01:00
889712927f Fix Cycles crash collecting render stats 2022-01-23 16:30:57 +01:00
5c4a5fd40d Cleanup: Improvements to mesh to bmesh conversion
- Use `Array` and `Span` instead of raw pointers.
- Declare variables in smaller scope.
- Use references instead of pointers.
2022-01-22 18:09:30 -06:00
6cd977b903 Fix T94760: Crash building BMesh when opening file
A large polygon in the file from the report caused `alloca`
to exceed the maximum stack size, causing a crash.  Instead
of using `alloca`, use `blender::Array` with an inline buffer.

Based on a patch by Germano Cavalcante (@mano-wii).

Differential Revision: https://developer.blender.org/D13898
2022-01-22 13:06:15 -06:00
dde997086c LineArt: Option to keep contour when using face mark filtering.
When enabled, it will keep contour around the object instead of hide them by rule of face mark,
so the object can always have full contour while filtering out some of the feature lines inside certain regions.

Reviewed By: Antonio Vazquez (antoniov), Aleš Jelovčan (frogstomp)

Differential Revision: https://developer.blender.org/D13847
2022-01-22 16:57:25 +08:00
579e8ebe79 LineArt: Back face culling
Option to discard back faced triangles, this speeds up calculation especially for when you only want to show visible feature lines.

Reviewed By: Antonio Vazquez (antoniov), Aleš Jelovčan (frogstomp)

Differential Revision: https://developer.blender.org/D13848
2022-01-22 16:41:08 +08:00
5ae76fae90 LineArt: Noise tolerant chaining.
Instead of splitting it at each occlusion change, it tolerates short segments of "zig-zag" occlusion incoherence and doesn't split the chain at these points, thus creating a much smoother result.

Reviewed By: Antonio Vazquez (antoniov), Aleš Jelovčan (frogstomp)

Differential Revision: https://developer.blender.org/D13851
2022-01-22 16:13:44 +08:00
e88d966737 BMesh: merge normal and tessellation calculation on undo
This gives a modest speedup as calculating tessellation and face
normals at the same time can be more efficiently multi-threaded.

Also avoids calculating face normals twice,
oversight in d590e223da.
2022-01-22 18:02:12 +11:00
25c99e72cd Fix linking in debug mode
b7878a4d45 seems to have caused linking
issues building debug mode on Linux.

Using extern "C" resolves.
2022-01-22 17:59:09 +11:00
b7878a4d45 Cleanup: Move bmesh_mesh_convert.c to C++
Useful for a simpler bug fix, code clarity,
and easier possible optimizations in the future.
2022-01-21 23:53:15 -06:00
Aras Pranckevicius
9350005d8b Fix T13879 new OBJ exporter not saving files with Unicode characters.
Need to use BLI_fopen instead of fopen.
2022-01-21 20:14:01 -05:00
1f026a3db9 Cleanup: Use references, const variables 2022-01-21 18:20:07 -06:00
Laurynas Duburas
45d038181a Curves: Improve accuracy and clarity of NURBS knots calculation
This commit improves NURBS knot generation by adding proper support
for the combination of the Bezier and cyclic options. In other cases
the resulting knot doesn't change. This cyclic Bezier knot is used to
create accurate accurate "Nurbs Circle", "Nurbs Cylinder" primitives.
"Nurbs Sphere" and "Nurbs Torus" primitives are also improved by
tweaking the spin operator.

The knot vector in 3rd order NURBS curve with Bezier option turned on
(without cyclic) is changed in comparison to previous calculations,
although it doesn't change the curve shape itself.

The accuracy of the of NURBS circle is fixed, which can be checked by
comparing with mesh circle. Tessellation spacing differences in
circular NURBS is also fixed, which is observable with the NURBS
cylinder and sphere primitives. These were causing seam-like effects.

This commit contains comments from Piotr Makal (@pmakal).

Differential Revision: https://developer.blender.org/D11664
2022-01-21 16:40:49 -06:00
d590e223da Fix T94974: Invalid normals in edit mode
Normal layers currently aren't stored in the undo step
mesh storage, since they are not stored in files at all.
However, the edit mesh expects normals to be fully
calculated, and does not keep track of a dirty state.
This patch updates the normals in the BMesh created
by loading an undo step.

Another option would be calculating the normals on
the undo mesh first, which might be better if Mesh
normal calculation is faster than BMesh calculation,
but the preferred method to access vertex normals fails
in this case, because the mesh runtime mutexes are not
initialized for undo-state meshes.

Differential Revision: https://developer.blender.org/D13859
2022-01-21 16:14:00 -06:00
68aa35ae74 Fix T94967: Sculpt mode crashes with missing normals
From an error in rBcfa53e0fbeed, the vertex normals in `SculptSession`
seem to be used, but in the case when no "pbvh" is used, the value of
the pointer is never assigned.

Normals were not generally dirty before this "ensure" function with
regular sculpting operations, so this addition shouldn't have any cost.

Differential Revision: https://developer.blender.org/D13854
2022-01-21 16:12:12 -06:00
294ab84909 Fix T95097: Attribute Capture node UI inconsistency
All other nodes with data type and domain choices have the domain
below the data type. Generally that order makes sense, because it's
consistent with nodes that have no domain drop-down.
2022-01-21 16:08:21 -06:00
1c23a06706 Fix: Applying object transform can create normal layers
Because this operator is used on original objects, it's best to tag
the normals dirty instead of explicitly calculating them, to avoid
unnecessarily storing normal layers on an original object (since
they might have to be recalculated during evaluation anyway).
There may be other places this change is helpful, but being
conservative is likely better for now.

Related to T95125
2022-01-21 16:04:16 -06:00
e07b217669 Build: update macOS for FreeType library with woff2 support
Ref D13448, T93161
2022-01-21 21:36:00 +01:00
32ceb0b807 Fix std::optional value() build error on older macOS SDK
No longer happens on the buildbot, but for users building with an older
Xcode we still need to avoid using value().
2022-01-21 21:36:00 +01:00
4f9be46526 Distribute Points on Faces: Fix missing minimum value for density socket
Negative number density is not a part of this reality.
2022-01-21 15:31:51 -05:00
54d69a2fd1 Fix new OBJ exporter to handle instancing.
The new OBJ exporter did not handle object instances.
The fix is to use a dependency graph iterator, asking for instances.
Unfortunately that iterator makes a temporary copy of instance objects
that does not persist past the iteration, but we need to save all the
objects and meshes to write later, so the Object has to be copied now.

This changed some unit tests. Even though the tests don't have instancing,
the iterator also picks up some Text objects as Mesh ones (which is a good
thing), resulting in two more objects in the all_objects.obj file output.
2022-01-21 14:37:33 -05:00
9d274a609c cmake/win: Platform update for freetype 2.11.0
freetype now depends on brotli
2022-01-21 11:40:53 -07:00
58f8eb54a3 deps/win: fix typo in brotli.cmake
it was harvesting to the zstd folder which
is not where these libs ought to be.
2022-01-21 11:36:56 -07:00
RUben
5b90c046d5 Fix: Object selection delay with many objects
With object collection properties open there was a huge delay when
switching active objects in a large scene, (~10k objects, ~5m vertices).
This is due to a non-optimal function to query all the collections the object is in.

To solve this the code can be simplified by using `bpy.types.Object.users_collection`
This returns all the collections the object is in removing the need to compute this in python.
2022-01-21 13:13:04 -05:00
c20f209b1c Cmake/Deps: Freetype 2.11.0 / brotli 1.0.9
The UI team requested adding woff2 support to freetype.
this required a new dependency brotli.

This changes adds brotili to the builder and bumps
freetype to version 2.11.0

As freetype now depends on other libraries, for consistency
all use of ${FREETYPE_LIBRARY} in cmake has been updated to
use ${FREETYPE_LIBRARIES} adjustments have been made in the
windows platform file, all other platforms use cmake's
FindFreeType.cmake which already sets this variable.

reviewed by: brecht

Differential Revision: https://developer.blender.org/D13448
2022-01-21 10:26:05 -07:00
59fc95bf97 UI: Clarify Active Movie Clip tooltip
See T92299
2022-01-21 12:02:34 -05:00
d034b85f33 Geometry Nodes: new Scale Elements nodes
This node can scale individual edges and faces. When multiple selected
faces/edges share the same vertices, they are scaled together.
The center and scaling factor is averaged in this case.

For some examples see D13757.

Differential Revision: https://developer.blender.org/D13757
2022-01-21 17:34:47 +01:00
cab88a1c72 Merge branch 'master' into greasepencil-object 2022-01-21 16:36:11 +01:00
Alan Babu
c39d514a4e Geometry Nodes: Flip Faces Node
Currently there is no way to flip normals in geometry nodes. This node
makes that possible by flipping the winding order of selected faces.
The node is purposely not called "Flip Normals", because normals are
derived data, changing them is only a side effect. The real change is
that the vertex and edge indices in the face corners of every selected
polygon are reversed, and face corner attribute data is reversed.

While there are existing utilities to flip a polygon and its custom
data, this node aims to process an attribute's data together instead
of processing all attributes separately for each index.

Differential Revision: https://developer.blender.org/D13809
2022-01-21 09:26:40 -06:00
4251455dcd Geometry Nodes: Mesh Island Node - Rename Index Socket
Rename 'Index' Socket to 'Island Index' to make it more consistent with
'Island Count'

Differential Revision: https://developer.blender.org/D13893
2022-01-21 09:01:18 -06:00
87c5423c5e Geometry Nodes: New Output for Number of Mesh Islands
Adds a second output to the Mesh Islands node that shows the total
number of islands as a field.

Differential Revision: https://developer.blender.org/D13700
2022-01-21 08:30:02 -06:00
Brecht Van Lommel
d68ce0e475 Cycles: add pointcloud implementation for Metal RT
This is not currently working, with an internal compiler error. However
we are currently using BVH2 instead of Metal RT. So this has no effect for
users, it's being committed to avoid the code getting outdated.

Ref T92573, T92212

Differential Revision: https://developer.blender.org/D13632
2022-01-21 14:42:27 +01:00
5e51a5e8a4 Fix error in previous commit. 2022-01-21 14:35:27 +01:00
93065a67c6 GPU: Disable create info for 2d image overlay merge.
This shader needs to use the same interface as the OCIO shader. On Linux
and Windows this seems to be the case. On MacOS however there is a
mismatch that makes the overlay texture to be completely black when
switching to workbench in the Shader workspace.

This is just a temporarily work-around as this should be solved. Due to
the poor GPU debugging facilities on Mac we haven't been able to
pin-point the root cause.
2022-01-21 14:24:30 +01:00
f6888b530a Attributes: add operator to convert generic attributes to other types
Editing of generic attributes on the original objects in edit modes is
still very limited. However, when applying a geometry nodes modifier
that generates new attributes. These attributes will show up in the
Attributes panel.

Currently, our exporters are not capable of exporting generic attributes.
Therefore, for the time being, a work around is to apply geometry nodes
and then convert a generic attribute to a task specific attribute like a
uv map, vertex group or vertex color layer. Once more parts of Blender
support generic attributes, this will become less important.

Currently, only meshes are supported by the operator. However, it would
be relatively easy to extend it to other geometry types.

Differential Revision: https://developer.blender.org/D13838
2022-01-21 12:47:35 +01:00
36c40760a5 .obj: simplify templates in FileHandler, add comments
- Remove redundant template from `FormattingSyntax`.
- Replace one enable_if with static assert for readability
- Add comments

No functional change expected.

Reviewed by: jacqueslucke
Differential Revision: https://developer.blender.org/D13882
2022-01-21 15:28:04 +05:30
23fa5bb723 GPU: Remove unused resources in shader create info.
When adding the shader create infos some additional resources where defined
that doesn't exist in the shader itself. This commit will remove them.
2022-01-21 09:58:58 +01:00
64196a6b29 Cleanup: struct/class mismatch. 2022-01-21 07:52:10 +01:00
872dc1038c UI: exclude "Undo History" from menu search
Undo history was showing in menu search since converting undo history to
a menu from a popup, see: 0e1bb232e6.
2022-01-21 16:30:11 +11:00
53923f502d Fix T95078: Setting digits as modifier in keymap doesn't work
Allow any non-modifier keyboard events to be used.

Note that the existing check for >= EVT_AKEY allowed NDOF and other
non-keyboard events (including modifiers, which didn't work).
2022-01-21 15:20:02 +11:00
20655128c9 Cleanup: event type values & defines
- Use defines instead of magic numbers for F-Key & NDOF range checks.
- Use explicit values for NDOF event types.
- Minor clarification to doc-strings.
- Use doxy-sections.
2022-01-21 15:19:00 +11:00
5fca280c80 Fix: Node link drag search doesn't list shader sockets
Shader sockets were only available when dragging from inputs.
2022-01-20 16:26:43 -06:00
1ac2d2dcb6 Fix T93711: Cycles diffuse/glossy baking does not write alpha
With the change to use render passes internally the alpha channel got lost.
Add support for these render passes to output an alpha channel for baking.
2022-01-20 22:32:35 +01:00
14d261d23a Cleanup: Resolve unused variable warning, make function static 2022-01-20 15:10:56 -06:00
9ca1052226 Fix Python API docs build error
There is probably a better solution that's possible, but the few other
things I tried didn't work, and the build error should be resolved for
the buildbots. This is similar to the "breaks" in the namespace for
functions declared in `ED_node.h`.
2022-01-20 15:10:28 -06:00
4369c5817a Fix T94457: random result using sky texture in light object
Still not well defined, but should not longer use uninitialized values that
gave different results between CPU/GPU and subsequent renders.
2022-01-20 21:28:41 +01:00
22a8e934e4 Fix T94698: artifacts in light passes with mixed volumes and surfaces 2022-01-20 20:55:43 +01:00
e1ae95f6b2 Fix T93520: wrong subframe motion blur with rigid body physics
The code here was using velocity based interpolation copied from particles.
However there is no velocity cached in the rigid body point cache so the
results were non-sensical.
2022-01-20 20:40:55 +01:00
24e00c115c Fix T94712: Cycles missing colorspace transform on grayscale images 2022-01-20 20:40:55 +01:00
2559d79d2f Fix T94582: Cycles mapping shader node incorrectly skipped in Normal mode
Even if no rotation or scale is specified, we must still always normalize
the output.
2022-01-20 20:40:55 +01:00
Charlie Jolly
cc1a48e395 Geometry Nodes: Curve Primitive Arc
This adds a new curve primitive to generate arcs.

Radius mode (default): Generates a fixed radius arc on XY plane
with controls for Angle, Sweep and Invert.

Points mode: Generates a three point curve arc from Start to End
via Middle with an Angle Offset and option to invert the arc.
There are also outputs for arc center, radius and normal direction
relative to the Z-axis.

This patch is based on previous patches
D11713 and D13100 from @guitargeek. Thank you.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D13640
2022-01-20 19:04:09 +00:00
6baccc36a0 Fix continuous stream of thumbnail notifiers after redo
This fixes a similar issue as the previous commit, but this time the
continuous notifiers would be sent after redoing. E.g. after moving an
object, and then modifying the transform in the "Adjust Last Operation"
panel.
2022-01-20 18:51:49 +01:00
d552b3c0c0 Fix file/asset thumbnails causing constant stream of notifiers
The thumbnail caching continuously sends `ND_SPACE_FILE_PREVIEW`
notifiers via a timer. But this timer was never ended properly after
thumbnails are fully loaded into the cache.
Wouldn't actually cause a refresh or redraw, send and process the
notifiers.

I already tried to avoid this for the asset view template, but
apparently that wasn't working correctly. For the File/Asset Browser I
never applied that fix to avoid possible regressions before the release.
2022-01-20 18:51:49 +01:00
902a103f80 Cleanup: Move node editor files to proper namespace
This commit moves code in all node editor files to the
`blender::ed::space_node` namespace, except for C API
functions defined in `ED_node.h`, which can only be moved
once all areas calling them are moved to C++.

The change is fairly straightforward, I just moved a couple
of "ED_" code blocks around to make the namespace more
contiguous, and there's the method for adding a pointer to
a struct in a C++ namespace in DNA.

Differential Revision: https://developer.blender.org/D13871
2022-01-20 10:36:56 -06:00
19622ffc5b Cleanup: Remove OpenCL workaround in volume_sample_channel(). 2022-01-20 17:02:20 +01:00
f6c8a78ac6 Cycles: Fix bvh2 gen on Apple Silicon and use it to speed up renders
This patch fixes a correctness issue discovered in the `int4 select(...)` function on Apple Silicon machines, which causes bad bvh2 builds. Although the generated bvh2s give correct renders, the resulting runtime performance is terrible. This fix allows us to switch over to bvh2 on Apple Silicon giving a significant performance uplift for many of the standard benchmarking assets. It also fixes some unit test failures stemming from the use of MetalRT, and trivially enables the new pointcloud primitive.

Ref T92212

Reviewed By: brecht

Maniphest Tasks: T92212

Differential Revision: https://developer.blender.org/D13877
2022-01-20 15:37:49 +00:00
9315215b20 Fix T94726: crash with GPU subdivision on a custom bone shape
Custom bones are drawn by instancing the GPUBatch of the base object. To
access the mesh and its GPUBatch, `BKE_object_get_evaluated_mesh` was
used. However, since GPU subdivision support, this will return a
subdivision wrapper which will never be drawn, and thus will have an
invalid batch, which caused the crash.

`BKE_object_get_evaluated_mesh_no_subsurf` should be used instead, to
return the mesh that will be drawn, and have the subdivision evaluated
on the GPU. Note that the rest of the draw code is already using this
function.
2022-01-20 15:28:08 +01:00
264fe10ddd Cleanup: Remove unused python helper function.
Branched Path has been removed with the Cycles X merge.
2022-01-20 14:34:20 +01:00
969a571e0f Revert "Sculpt: Multires Heal Brush"
This reverts commit ae349eb2d5.
2022-01-20 03:55:41 -08:00
4425e0cd64 Subdivision: add support for vertex creasing
This adds vertex creasing support for OpenSubDiv for modeling, rendering,
Alembic and USD I/O.

For modeling, vertex creasing follows the edge creasing implementation with an
operator accessible through the Vertex menu in Edit Mode, and some parameter in
the properties panel. The option in the Subsurf and Multires to use edge
creasing also affects vertex creasing.

The vertex crease data is stored as a CustomData layer, unlike edge creases
which for now are stored in `MEdge`, but will in the future also be moved to
a `CustomData` layer. See comments for details on the difference in behavior
for the `CD_CREASE` layer between egdes and vertices.

For Cycles this adds sockets on the Mesh node to hold data about which vertices
are creased (one socket for the indices, one for the weigths).

Viewport rendering of vertex creasing reuses the same color scheme as for edges
and creased vertices are drawn bigger than uncreased vertices.

For Alembic and USD, vertex crease support follows the edge crease
implementation, they are always read, but only exported if a `Subsurf` modifier
is present on the Mesh.

Reviewed By: brecht, fclem, sergey, sybren, campbellbarton

Differential Revision: https://developer.blender.org/D10145
2022-01-20 12:21:34 +01:00
9b4c017031 Cleanup: Remove incorrect comment 2022-01-19 23:56:27 -06:00
ae349eb2d5 Sculpt: Multires Heal Brush
This brush fixes the random spikes that
occasionally happen in multires models.
These spikes can be nearly impossible to
fix manually and can make working with
multires a nightmare.
2022-01-19 17:28:22 -08:00
eb3ff1d6f9 Cleanup: spelling in comments 2022-01-20 11:59:20 +11:00
1d536c21dd Cleanup: clang-format 2022-01-20 11:59:20 +11:00
e3f9d9b206 Cleanup: quiet ASAN warnings for divide by zero & NULL memcpy args
No functional changes as the inf value was never used &
memcpy args were only NULL when the size to copy was zero.
2022-01-20 11:59:20 +11:00
b7fe27314b Mesh RNA API: Expose contiguous normal arrays
Since vertex and face normals are now stored on the mesh when necessary,
we can expose them as contiguous arrays of vectors in the Python API.
This can give render engines and other addons easy access to they data
for fast access through a regular collection property.

While "Mesh Vertex" still has a "normal" property in RNA, that is only
maintained in order to avoid breaking the existing API, and accessing
it is less efficient than accessing the normals directly.

I made the normal arrays read-only, because modifying them could
put them in an invalid state. This is inline with how we treat the data
internally, and helps keep relationships between data clear.

Differential Revision: https://developer.blender.org/D13839
2022-01-19 18:43:05 -06:00
b47a1867e8 Cleanup doc comments for sculpt_intern.h 2022-01-19 16:21:14 -08:00
e7db1247b1 Fix: File Browser using asset indexer after Asset Browser was visible
When toggling to a File Browser from an Asset Browesr, the asset indexer
would be used to load files. I couldn't spot issues with that on a
quick look, but this should still be corrected.
2022-01-19 20:43:31 +01:00
293aab2253 Asset Browser: Add debug option to disable asset indexing
Adds an "Asset Indexing" option (enabled by default) to Preferences >
Experimental > Debugging. This is useful when working on the asset
library loading.
2022-01-19 20:12:53 +01:00
9a2d1cd5b7 PyAPI Docs: Prepare for Sphinx 4.5 2022-01-19 14:08:38 -05:00
cd0acba330 CMake: Support external callback in configuration
An external CMake script can be used to debug CMake code, modify/read
target properties, inter-target dependencies, non-cache variables etc.

Reviewed by: LazyDodo, brecht
Differential Revision: https://developer.blender.org/D13830
2022-01-20 00:15:09 +05:30
17cab47ed1 Cycles: Fix T94736: Crash when modifying strength of world environment texture
This patch fixes crash T94736 on Metal in which the launch_params were not being updated to reflect destruction of MetalMem objects.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D13875
2022-01-19 18:17:37 +00:00
596ce11556 CMake Cleanup: use set for filepath instead of option
See https://developer.blender.org/D13830#368219
2022-01-19 23:34:25 +05:30
f179637222 Fix T95042: Rendering high-res image in Cycles crashes
Integer overflow when the final frame is handled by the Blender's
output driver.

Thanks Jesse and Thomas for investigation!
2022-01-19 16:03:28 +01:00
ecf2f5ed01 Fix error in previous commit
While doing last minute cleanup in
e49bf4019b,  missed to rename function
in one place.
2022-01-19 14:32:11 +01:00
eddad4e9a1 VSE: Support copy-pasting strips with animation
When copying strips between 2 scenes, it wasn't possible to copy
animation curves along with strips.

In this patch curves are copied into clipboard `ListBase`. When pasted,
original curves are moved into temporary `ListBase` and curves in
clipboard are moved into scene action. This is because when strips from
clipboard have to be renamed, function `SEQ_ensure_unique_name()` does
fix RNA paths of curves, but this is done globally for all curves within
action. After strips are renamed, restore original curves from backup.

Note: This patch handles only fcurves. Drivers and actions are currently
not handled anywhere in VSE.

Fixes T77530

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D13845
2022-01-19 14:15:49 +01:00
e49bf4019b Cleanup: VSE animation handling
- Move functions that handle animation to own file - `animation.c`
- Refactor `SEQ_offset_animdata` and `SEQ_free_animdata` functions
- Add function `SEQ_fcurves_by_strip_get` to provide more granular
  and explicit way for operators to handle animation
- Remove function `SEQ_dupe_animdata`, do curve duplication explicitly
  in operator code, which makes more sense to do. Further this function
  was also used for renaming strips which makes no sense.
- Refactor usage of function `SEQ_free_animdata` and remove XXX comment.
  Now this functiuon is no longer called when `Sequence` data is freed
  implicitly, it is done explicitly in high level function
  `SEQ_edit_remove_flagged_sequences`

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D13852
2022-01-19 14:12:23 +01:00
1788298804 Cleanup: Strict compiler warning in Cycles
The ustring is not a trivially copyable object from the C++ standard
point of view, so using memcpy on it is strictly wrong. In practice,
however, this is OK since it is just a thin wrapper around char*.

For now use explicit cast to void* same as it was done in other places
of ccl::array implementation. But also localize the place where memory
copy happens to make it easier to support proper non-trivial C++
objects in the future.
2022-01-19 12:01:49 +01:00
8a23d91a50 GPUShaderCreateInfo: Rework geometry shader layout support
This merge the description into one struct only that can be more easily
copied during `finalize()`.

The in and out layout parameters are better named and extended with the
invocation count (with fallback support)
2022-01-19 11:59:57 +01:00
952a4fa456 Fix T94987: Dragged node links are invisible.
Route cause was data alignment mismatch between GPU and CPU. This
mismatch would not allow us to bind the UBO where data wasn't available
on the GPU.

Fixed by using float4 in stead of float2. This could eventually be
packed, but that would lead to less readable code.
2022-01-19 11:32:34 +01:00
71386c08f1 Fix T95039,T94998: Shaders compilation errors on Mac.
Cause was incorrect logic when generating the resource layout. It the
explicit_location_support setting was ignored and the binding were
generated for image, uniform buffers and storage buffers.
2022-01-19 10:28:19 +01:00
eb63646605 BMesh: add mesh debug information printing
- Add BM_mesh_debug_print & BM_mesh_debug_info.
- Report flags in Mesh.cd_flag in BKE_mesh_debug_print
- Move custom data printing into customdata.cc (noted as a TODO).

Note that the term "runtime" has been removed from
`BKE_mesh_runtime_debug_print` since these are useful for debugging any
kind of mesh data.
2022-01-19 17:16:00 +11:00
71879d665d BMesh: improve handling of custom-data flag (Mesh.cd_flag)
Code that handled merging & initializing custom-data from other
meshes sometimes missed checks for this flag, causing bevel weights to
lost when the mesh was converted to a BMesh.

The following changes are a more general fix for T94197.

- Add BM_mesh_copy_init_customdata_from_mesh_array which initializes
  custom-data from multiple meshes at once.
  As well as initializing custom-data layers from Mesh.cd_flag.

  This isn't essential for boolean, however it avoids the overhead of
  resizing custom-data layers.

- Loading mesh data into a BMesh now respects Mesh.cd_flag
  instead of only checking if the BMesh custom-data-layer exists.
  Without this, the order of meshes passed to BM_mesh_bm_from_me could
  give different (incorrect) results.

- Copying mesh data now copies `cd_flag` too. This is a precaution
  as in my tests evaluating modifiers these values always matched.
  Nevertheless it's correct to copy this value as custom-data it's
  self is being copied.
2022-01-19 14:30:10 +11:00
ee6507f2b1 Docs: notes on thumbnail sizes
The rationale for storing thumbnails at different sizes wasn't obvious.
2022-01-19 14:05:56 +11:00
7e3b1e2c8f Fix flipped order of items in the "Undo History" menu
Error in 0e1bb232e6.
2022-01-19 13:25:10 +11:00
2e5aecf557 Fix T94202: GPUFrameBuffer: wrong refcount in the buffer passed for read_color and read_depth
The buffer passed as an argument to `GPUFrameBuffer.read_color` is used
in the return of the function and therefore, if not used, its refcount is
decremented.

So be sure to increment the refcount of the already existing objects that
will be used in the return of a function.
2022-01-18 19:23:16 -03:00
221ff895d9 Cleanup: Use references, LISTBASE_FOREACH macro 2022-01-18 13:32:36 -06:00
a5610da1d5 Fix T93413: Nodes 'Make Links' fails for multi input socket
This was the case for multi input sockets that have a link already.

Since we have multi input sockets, the way we use `socket_is_available`
is not really giving the expected result on these.

When used for input sockets the intention is to find a free socket
(either for noodle **replacement**, then it is always available, or just
the next free available socket).
Now I would think without the intention to replace an existing link, a
multi input socket should still be available.
From the inside of the function, the `replace` argument turns [namewise]
to `allow_used`, which sounds a little different (so one might argue
that if `allow_used` is `False` this should also trigger for already
connected multi input sockets).
In the end, this is an issue with the variable naming though, cant think
of a usecase where the patch change would really go against intentions.

Maniphest Tasks: T93413

Differential Revision: https://developer.blender.org/D13866
2022-01-18 20:23:39 +01:00
9506dcf675 Fix T95029: Arrow gizmo always uses normal direction
Bug possibly introduced in {rBc57e4418bb85aec8bd3615fd775b990badb43d30}.

Interestingly, the orientation set before (NORMAL), even different from
the orientation that was actually used, was allowing the use of
"orient_matrix" ("orient_matrix_type" should have been NORMAL in that
case too).

In any case, make sure the "orient_matrix_type" and "orient_type" are the
same so that the "orient_matrix" is used.
2022-01-18 16:21:48 -03:00
977baeaa26 Cleanup: Make node editor functions private
These operations (sorting and selecting all nodes) should generally
be handled by the node editor and not outside code. They were not
called outside of the node editor, so they can be moved to the editor's
`intern` header.
2022-01-18 13:07:41 -06:00
09ecb089a5 Cleanup: Remove unused node editor toolbar file
This file was added nine years ago, and was unused then.
Now with active tools we use a different approach to create
toolbars, so the file is not relevant.
2022-01-18 12:31:14 -06:00
15657b7ccd Fix warning from rB9925606539. 2022-01-18 18:38:14 +03:00
b88a37a490 Geometry Nodes: new Field at Index node
This node allows accessing data of other elements in the context geometry.
It is similar to the Transfer Attribute node in Index mode. The main difference
is that this node does not require a geometry input, because the context
is used.

The node can e.g. be used to generalize what the Edge Vertices node is doing.
Instead of only being able to get the position of the vertices of an edge,
any field/attribute can be accessed on the vertices.

Differential Revision: https://developer.blender.org/D13825
2022-01-18 16:25:47 +01:00
4d5c08b938 Geometry Nodes: Add Signed Output to Edge Angle Node
Adds a second output to the edge angle node that shows the signed angle
between the two faces, where Convex angles are positive and Concave angles
are negative. This calculation is slower than the unsigned angle, so it
was best to leave both for times where the unsigned angle will suffice.

Differential Revision: https://developer.blender.org/D13796
2022-01-18 09:20:31 -06:00
796e9d442c Geometry Nodes: improve domain interpolation code
It's now easier than before to do the interpolation of attributes
only for the elements that are actually used in some cases.
This can result in a speedup because unnecessary computations
can be avoided. See the patch for a simple performance test.

Differential Revision: https://developer.blender.org/D13828
2022-01-18 16:14:00 +01:00
dfe22a53bb Fix T95003: Shader issue using voronoi noise.
Cause of the issue isn't that clear, but the NVIDIA GLSL compiler
complained that it couldn't find an overloaded function when the second
parameter is an interger. This change fixes it by using a float.
2022-01-18 14:32:26 +01:00
0d7b3ed39c RNA: display exact integer values without fraction if step is integer.
Display exact integer values of a floating point fields without
a fraction if the step is also an exact integer. This is intended
for cases when the value can technically be fractional, but most
commonly is supposed to be integer.

This handling is not applied if the field has any unit except frames,
because integer values aren't special for quantities like length.

The fraction is discarded in the normal display mode and when copying
the value to clipboard, but not when editing to remind the user that
the field allows fractions.

Differential Revision: https://developer.blender.org/D13753
2022-01-18 16:24:54 +03:00
6952228386 UI: fix a precision issue with float field step size.
Fix a precision issue when stepping down from 1 to 0 via the left
decrement button and step 100 results in a small nonzero value.

The reason is that 0.01 can't be precisely represented in binary
and converting to double before multiplication reveals this.

Ref D13753
2022-01-18 16:24:54 +03:00
6a8ad00bcc Cleanup: Avoid possible NULL pointer error
In normal conditions, `gpf` always has a value, but better move inside the NULL checking.
2022-01-18 13:44:41 +01:00
08d008a508 GPU: Create Info for GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR.
This patch converts GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR shader to use
the GPUShaderCreateInfo pattern. It can be used as a reference when
converting other shaders.

In this special case the flat uniform vector cannot be used anymore as it
doesn't fit as push constants. To solve this a uniform buffer is used.
2022-01-18 13:17:04 +01:00
2486346f6f Fix T94977: muted link is not ignored in eevee
Add a preprocessing step that removes all muted links from
the localized node tree.

Differential Revision: https://developer.blender.org/D13864
2022-01-18 13:06:49 +01:00
9f8ae130af Fix T95006: missing modifier update after frame change
The previous optimization did not work in general yet, unfortunately.
This change makes the code more correct, but also brings back
some unnecessary updates (e.g. when creating a node group).
2022-01-18 12:58:29 +01:00
5d7ac749c5 Fix T94197: Applying boolean with fast solver clears bevel weights
For boolean operations only one of the meshes was checked to determine
if bevel weights should be created.

Now initialize custom data from both meshes flag.
Note that this is a localized fix to be back-ported, further changes
will be made so edit-mode conversion accounts for this
without the caller needing explicit checks for custom-data flags.
2022-01-18 21:35:10 +11:00
fce0b824a7 Assets: Enabling Asset Indexing.
Asset indexing was disabled as ID property indexing wasn't supported.
Now that ID property support is added we can enable asset indexing.

Check {T91406} for more information about asset indexing.
2022-01-18 11:20:50 +01:00
Jeroen Bakker
36068487d0 AssetsBrowser: Add ID Properties to Asset Indexer
Object/collection asset workflow would need the bounding box for snapping.
The bounding box is stored using ID properties in the scene. Currently ID properties
aren't stored in the asset index, what would break object snapping. For this reason
Asset Indexing is turned off in mater. This patch will introduce the indexing of ID
properties what will allow the indexing to be turned on again.

## Data Mapping ##

For data mapping we store the internal structure of IDProperty to the indexer (including meta-data) to be able to deserialize it back.
```
[
  {
    "name":  ..,
    "value": ..,
    "type": ..,
    /* `subtype` and `length` are only available for IDP_ARRAYs. */
    "subtype": ..,
  },
]
```

| **DNA** | **Serialize type** | **Note** |
| IDProperty.name | StringValue| |
| IDProperty.type | StringValue| "IDP_STRING", "IDP_INT", "IDP_FLOAT", "IDP_ARRAY", "IDP_GROUP", "IDP_DOUBLE"|
| IDProperty.subtype | StringValue| "IDP_INT", "IDP_FLOAT", "IDP_GROUP", "IDP_DOUBLE" |
| IDProperty.value | StringValue | When type is IDP_STRING |
| IDProperty.value | IntValue | When type is IDP_INT |
| IDProperty.value | DoubleValue | When type is IDP_FLOAT/IDP_DOUBLE |
| IDProperty.value | ArrayValue | When type is IDP_GROUP. Recursively uses the same structure as described in this section. |
| IDProperty.value | ArrayValue | When type is IDP_ARRAY. Each element holds a single element as described in this section. |

NOTE: IDP_ID and IDP_IDARRAY aren't supported. The entry will not be added.

Example
```
[
  {
    "name": "MyIntValue,
    "type": "IDP_INT",
    "value": 6,
  },
  {
    "name": "myComplexArray",
    "type": "IDP_ARRAY",
    "subtype": "IDP_GROUP",
    "value": [
        [
          {
            "name": ..
            ....
          }
        ]
    ]
  }
]
```

## Considered alternatives ##

- Add conversion functions inside `asset_indexer`; makes generic code part of a specific solution.
- Add conversion functions inside `BLI_serialize`; would add data transformation responsibilities inside a unit that is currently only responsible for formatting.
- Use direct mapping between IDP properties and Values; leads to missing information and edge cases (empty primitive arrays) that could not be de-serialized.

Reviewed By: Severin, mont29, HooglyBoogly

Maniphest Tasks: T92306

Differential Revision: https://developer.blender.org/D12990
2022-01-18 11:18:11 +01:00
d7822981b1 Python API Docs: add non-invert Bone.convert_local_to_pose example.
This updates the example function to support assigning a subset of
bone matrices. The code was tested to work in real use by @gaiaclary.
2022-01-18 11:45:27 +03:00
542d15b1cd Allow overriding motion path settings.
Motion paths themselves aren't getting saved (not sure if they are
without overrides), but being able to override options makes them
usable even if it's necessary to regenerate every edit session.

Differential Revision: https://developer.blender.org/D13842
2022-01-18 11:45:27 +03:00
1b94631975 CMake: Fix using numpy variable for the zstandard path
Copy paste error in a5917175d8.
2022-01-18 17:23:19 +11:00
6dd89afa96 Fix obj exporter tests by deduping normals and printing with less precision.
Some new obj exporter tests were disabled because the normals were different
in the last decimal place on different platforms.
The old python exporter deduped normals with their coordinates rounded to
four decimal places. This change does the same in the new exporter.
On one test, this produced a file 25% smaller and even ran 10% faster.
2022-01-17 23:22:40 -05:00
db496a0b7d Cleanup: spelling in comments 2022-01-18 14:27:29 +11:00
20df402adc Cleanup: move docs to definition 2022-01-18 14:13:58 +11:00
7220897280 WM: batch rename support for volume & light object data
Also order items to match the "Add" menu.
2022-01-18 12:23:15 +11:00
75d84b1b64 WM: batch rename outliner support for various ID types
The outliner selection can now be used for renaming objects,
object-data & materials.
2022-01-18 12:12:05 +11:00
0fc9526178 Fix for batch rename operating on library collections & materials 2022-01-18 11:50:02 +11:00
84f6d86445 Fix batch renaming selected meta-strips 2022-01-18 11:13:05 +11:00
c11c2a4b91 WM: batch rename collections outside the outliner
Use selected objects collection instances to rename in the 3D view.
2022-01-18 10:47:12 +11:00
Red Mser
54fb1a75ee WM: batch rename collections
User must activate the operator from the outliner,
so that the selected collections can be determined.

Reviewed By: campbellbarton

Ref D13821
2022-01-18 10:26:20 +11:00
0fa36c81d9 Cleanup: quite old-style-declaration warning, strip trailing space 2022-01-18 10:26:18 +11:00
3bbb39ecc1 Cleanup: remove HWND from GHOST_Wintab constructor.
No change in behavior.
2022-01-17 14:07:08 -08:00
44ca984dc7 BLI: Add index_range method to VectorSet
This can simplify iterating through all of the indices in the vector,
which is fairly common, since one of the benefits of the data structure
is that all values are contiguous.
2022-01-17 15:10:52 -06:00
8c1ddee10c Geometry Nodes: Set Handle Type Node: Left and right by default
This node's UI uses a multi-select enum to allow adjusting the
type of both handle sides with the same node. Since usually the
user wants to affect both handles, and it's the multi-select behavior
isn't obvious, selecting both by default is an improvement.
2022-01-17 15:02:15 -06:00
b776c46d2f Fix T94715: multiple volumes using the same .vdb causes freeze
Needs more TBB task isolation, as even freeing an OpenVDB grid uses
multithreading.
2022-01-17 20:36:59 +01:00
Martijn Versteegh
449db0ab1e Baking: new method to generate margin, based on adjacent faces
This significantly reduces discontinuities on UV seams, by giving a better
match of the texture filtered colors on both sides of the seam. It works by
using pixels from adjacent faces across the UV seam.

This new option is called "Adjacent Faces" and is the default. The old option
is called "Extend", and extends border pixels outwards.

Differential Revision: https://developer.blender.org/D13303
2022-01-17 19:36:13 +01:00
8af22719d0 Cleanup: Remove now redundant performance workaround for asset previews
Not needed anymore after aa0ecd179. The removed function was identical
to `icon_draw_rect()` now.

Reverts ab7214ca2e.
2022-01-17 18:26:32 +01:00
fa1fef5081 Cleanup: Correct comments for immediate mode buffer draw functions 2022-01-17 18:26:10 +01:00
194979e929 Cleanup: Improve naming of immediate mode buffer draw functions
Followup to the previous commit. Jeroen and I agreed the old naming was
confusing.
2022-01-17 18:26:10 +01:00
aa0ecd1791 UI: Speed up icon scaling
Use GPU-side scaling to speed up the scaling itself, and to avoid having
to copy the image buffer using the CPU. Mipmapping is used to get decent
filtering when downscaling without ugly artifacts.
In my comparisons, there was barely any difference between the methods
for DPIs >= 1. Below that, the result looks a bit different due to the
different filtering method.

See D13144 for screen-recordings showing the difference.

Part of T92922.

Differential Revision: https://developer.blender.org/D13144

Reviewed by: Jeroen Bakker
2022-01-17 18:26:10 +01:00
4d10a46e63 Cleanup: refactor BVH2 in preparation of self intersection skip
Move some logic out of triangle intersection functions and into BVH
traversal, so we can share logic between primitives.

Ref D12954
2022-01-17 17:35:23 +01:00
a25cfc5db2 Texture/Vertex Paint: Add secondary color to the tool header
Before we would only display the secondary color in the N-panel.
Now we also display it in the tool header.
2022-01-17 16:50:20 +01:00
be8f10a4e2 T94828: Appending collection with instancing links nested collections
See T94828 for details.

Differential Revision: https://developer.blender.org/D13803

Reviewed by: Bastien Montagne
2022-01-17 16:32:50 +01:00
e3fd0b1d17 Fix compiler warning on Windows
The variable was `uint64_t` and needs `1ull`
2022-01-17 16:08:48 +01:00
7abdd82dfd Fix T94338: bpy.data.libraries.load does not return the right thing.
Typo in rB605cdc4346e5f82, both `eBlendfileLinkAppendForeachItemFlag`
flags had the same value, effectively preventing to filter out direct
vs. indirect appended items.
2022-01-17 15:22:22 +01:00
59fcbdd815 Cleanup: deduplicate condition in transform curve code
Checking `t->around` and `nu->pntsv` does not need to be done in 2 places.
2022-01-17 11:14:44 -03:00
0a08ac2528 Alembic: add support for reading override layers
Override layers are a standard feature of Alembic, where archives can override
data from other archives, provided that the hierarchies match.

This is useful for modifying a UV map, updating an animation, or even creating
some sort of LOD system where low resolution meshes are swapped by high resolution
versions.

It is possible to add UV maps and vertex colors using this system, however, they
will only appear in the spreadsheet editor when viewing evaluated data, as the UV
map and Vertex color UI only show data present on the original mesh.

Implementation wise, this adds a `CacheFileLayer` data structure to the `CacheFile`
DNA, as well as some operators and UI to present and manage the layers. For both
the Alembic importer and the Cycles procedural, the main change is creating an
archive from a list of filepaths, instead of a single one.

After importing the base file through the regular import operator, layers can be added
to or removed from the `CacheFile` via the UI list under the `Override Layers` panel
located in the Mesh Sequence Cache modifier. Layers can also be moved around or
hidden.

See differential page for tests files and demos.

Reviewed by: brecht, sybren

Differential Revision: https://developer.blender.org/D13603
2022-01-17 14:51:04 +01:00
9d3f35a0bf Revert "Revert "GPUShaderCreateInfo for interface abstraction""
This reverts commit edee5a947b.

Fixes compilation error (Missing file BLI_float2.hh)
2022-01-17 14:46:32 +01:00
edee5a947b Revert "GPUShaderCreateInfo for interface abstraction"
This reverts commit 8fb2ff458b.
Missing some files.
2022-01-17 14:34:28 +01:00
Jeroen Bakker
8fb2ff458b GPUShaderCreateInfo for interface abstraction
This is a first part of the Shader Create Info system could be.

A shader create info provides a way to define shader structure, resources
and interfaces. This makes for a quick way to provide backend agnostic
binding informations while also making shader variations easy to declare.

- Clear source input (only one file). Cleans up the GPU api since we can create a
  shader from one descriptor
- Resources and interfaces are generated by the backend (much simpler than parsing).
- Bindings are explicit from position in the array.
- GPUShaderInterface becomes a trivial translation of enums and string copy.
- No external dependency to third party lib.
- Cleaner code, less fragmentation of resources in several libs.
- Easy to modify / extend at runtime.
- no parser involve, very easy to code.
- Does not hold any data, can be static and kept on disc.
- Could hold precompiled bytecode for static shaders.

This also includes a new global dependency system.
GLSL shaders can include other sources by using #pragma BLENDER_REQUIRE(...).

This patch already migrated several builtin shaders. Other shaders should be migrated
one at a time, and could be done inside master.

There is a new compile directive `WITH_GPU_SHADER_BUILDER` this is an optional
directive for linting shaders to increase turn around time.

What is remaining:
- pyGPU API {T94975}
- Migration of other shaders. This could be a community effort.

Reviewed By: jbakker

Maniphest Tasks: T94975

Differential Revision: https://developer.blender.org/D13360
2022-01-17 14:32:28 +01:00
08822801ac Fix T94805: Library weak reference generates "path not found" reports.
No reason to handle those paths here, those are fully internal temp
data, user should not be exposed to it currently.
2022-01-17 14:22:59 +01:00
04feaa8bd0 Core: Library Remap test cases.
For an upcoming refactoring of library remapping we want to be able to test if the logic won't change.
It also increased my experience inside the remapping codebase and find out what exactly needed to
be refactored.

This patch adds test cases for the core functionality of `foreach_libblock_remap_callback`. The test cases
don't cover of all the branches. Also pre-, post-processing, referencing and proxies are not tested.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D13815
2022-01-17 12:45:37 +01:00
e15449623d InstallDeps: Increase 'MEX' version of llvm to 14.
llvm 13 is now default on debian testing, tried it quickly and it seems
to work fine, so raising exclusive maximum value for it to 14.
2022-01-17 10:34:34 +01:00
40c8e23d48 LineArt: Invert collection option.
Allows conveniently selecting an inverse of a collection.

Reviewed By: Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D13846
2022-01-17 17:22:09 +08:00
e1e3043a51 CMake: resolve issue finding mold
The default installation path uses `libexec`, missed this as the
package for Arch replaces this with `lib`,
now both are checked.
2022-01-17 18:12:15 +11:00
Piotr Makal
a84621347d Geometry Nodes: Improve conversion from NURBS to Bezier
This patch improves conversion method from NURBS to Bezier curves,
resulting in exact shape between those two types when provided with
a 3rd degree NURBS curve. Part of T86086.

See the differential revision for more comparisons.

The node still cannot account properly for a NURBS "order" other
than 4 and it does not take into account control point weights.

Differential Revision: https://developer.blender.org/D13546
2022-01-16 22:52:18 -06:00
Alaska
34d424fd64 Fix T94526: Incorrect workspace ordering tooltip
Fix the description for WORKSPACE_OT_reorder_to_back to say "last" in
list rather than "first"

See D13696 for more details.

Differential Revision: https://developer.blender.org/D13696

Reviewed by Aaron Carlisle
2022-01-16 15:26:08 -08:00
d914cfcb7a Cleanup: simplify parameters
Use a common `userdata` for the different snap callbacks.
2022-01-16 11:25:51 -03:00
608d51c9c8 Fix T94951: Crash when snapping
Missed in {rBd9c6ceb3b88b6db87490b08e0089f9a18e6c52d6}
2022-01-16 11:25:51 -03:00
bc66cd9868 Fix T94865: GPU subdiv crash switching to texpaint area
The crash is due to the fact that GPU subdivision extraction routines
for edit data (including UVs) only worked for BMesh. However, a Mesh
based version is still needed for texture painting. This adds the
missing components. This also ensures all data are properly initialized
(at least the ones revealed by the bug).
2022-01-16 08:40:38 +01:00
3574f2730d Cleanup: deduplicate GPU subdiv data extraction loops
This puts the loop over the final subdivision quads outside of the mesh
iteration callback. This can also allow for easier parallel execution in
the future if need be.
2022-01-16 07:31:26 +01:00
b87d87b1d3 macOS: fix llvm-ranlib invalid option error 2022-01-16 11:47:55 +05:30
e69020ad0f CMake: only ever enable one alternative linker for UNIX/GCC
Since the option to enable linkers are booleans,
it's possible to enable them all at once.

Now only the first enabled + available linker is used
(with priority given to link is with better performance).
2022-01-15 16:40:24 +11:00
18c5d4ccb3 CMake: use LINKER flags instead of CFLAGS for setting the linker
Set the linker using CMAKE_*_LINKER_FLAGS instead of {C/CXX}FLAGS.

There is no advantage in using the CFLAGS to set the linker, it has the
downside of triggering a full rebuild when changing the linker.

Tested building Blender and the bpy.so Python module.

Ref D13833

Reviewed by: sergey, brecht
2022-01-15 16:12:13 +11:00
9664cc91f3 Fix T94918: GPU subdivision uses viewport levels for final render
The resolution for the subdivision grid traversal was always based on
the viewport setting.
2022-01-15 01:36:18 +01:00
6a16a9e661 Geometry Nodes: Rename transfer attribute geometry input
Conceptually, this is the geometry that data is taken from,
not the target of an operation, so rename it from "Target"
to "Source". This was common user feedback and agreed
on in a recent sub-module meeting.
2022-01-14 16:42:04 -06:00
6e926e9b56 Fix T94852: Geometry Proximity crash when unsuccessful
Before rB644e6c7a3e99ae1d43ed, `fill` was used in the error
cases, but now `fill_indices` is used, which doesn't work when
the span is empty (when only one output is used). The fix is just
to check for that case.
2022-01-14 16:10:38 -06:00
2a095d8bfe Audaspace: port bugfixes from upstream.
Windows audio backend (WASAPI) now automatically switches to
the selected audio device in windows.
2022-01-14 22:51:35 +01:00
9fe704800e Nodes: Support link-drag search with compare node outputs
The search list only displayed the "Result" output socket in this
case, which is unexpected since dragging from an input gives the
operations in the list as well. Also use integer mode when
connecting to boolean sockets.
2022-01-14 14:38:49 -06:00
b7a27efd78 Cleanup: Remove unused subdiv functions
I noticed these when doing final cleanup on rBcfa53e0fbeed.
One use was removed in that commit, the others were unused
going further back a few years.

Differential Revision: https://developer.blender.org/D13834
2022-01-14 14:04:24 -06:00
bba95d1901 Fix possible build error with unity build
`NodeOperationBuilder::Link` could conflict with the list base macros.
To resolve this dont use `using Link`.
2022-01-14 13:46:31 -05:00
67517c7d5c Cleanup: Outliner function names, simplify struct initialization 2022-01-14 19:26:04 +01:00
41495707d2 Fix incorrect destruction of Outliner tree-elements
`TreeElement` isn't a trivial type anymore, so `MEM_delete()` should be
called, which calls the destructor.
AFAICS this would cause a memory leak, since the contained `unique_ptr`
is allocated but not destructed correctly - but it's not using the
guarded allocator so woudn't be reported.
2022-01-14 19:26:04 +01:00
82d5905e4b Cleanup: Use destructor to delete Outliner runtime data
Simplifies and makes things safer due to proper RAII usage.
2022-01-14 19:26:04 +01:00
ca9a749b21 Cleanup: Use smart pointers for Outliner tree display and element types
Smart pointers should be the default choice for C++ owning pointers,
since they let you manage memory using RAII.

Also moved type factory methods into static class functions.
2022-01-14 19:26:04 +01:00
e9a43a3b60 Cleanup: Remove Outliner C-API headers/wrappers
Basically this removes any C <-> C++ glue code. C++ types are accessed
directly via the public C++ APIs.
Contains some related changes like, moving functions that were
previously declared in a now removed header to a different file, whose
header is the more appropriate place (and the source file as well).
But generally I tried to avoid other changes.
2022-01-14 19:26:04 +01:00
9109ea0b96 Disable some failing new obj exporter tests.
The switch to how normals are kept has led to tiny differences in
the normal output values on different platforms. Disabling the failing
tests while working on a solution to this problem.
2022-01-14 12:34:07 -05:00
5703efab88 Fix T94784: Crop node gizmo doesn't work
Fix refactoring mistake in rBcbca71a7cff3
Not the min and max values are initialized properly.
2022-01-14 17:44:18 +01:00
d723fa3d31 blenlib Any tests: Fix unknown pragma warning on Windows.
Part of a5cb7c1e62 is reverted since it 
created unknown pragma warning on windows.
Use a trick to do self-assigning.
Reviewed by Jacques Lucke in chat.
2022-01-14 22:10:28 +05:30
780633ec4b Cleanup: Unused function 2022-01-14 17:37:14 +01:00
301bb5afa5 Cleanup: Remove unused functions 2022-01-14 17:06:16 +01:00
eb33ee566e Fix T: Crash in do-version of older pre-2.80 blender files.
`BKE_layer_collection_sync` was missing a specific handling for one of
those pre-master collection cases,

NOTE: It is a bit unfortunate to have to do 'do-version' code in BKE...
At some point might look into moving this into actual `do_version` file,
but this is not fully trivial not critical improvement for now.
2022-01-14 17:02:05 +01:00
85df7036f7 Fix T94827: Group Input/Output cannot connect to custom sockets
Caused by rBa5c59fb90ef9.

Since Group Input and Output sockets happen to be of type `SOCK_CUSTOM`
[and since rBa5c59fb90ef9 custom py defined sockets are too :)] a check
introduced in rB513066e8ad6f that prevents connections for `SOCK_CUSTOM`
triggered.

Now refine the check, so it specifically looks for NODE_GROUP_INPUT /
NODE_GROUP_OUTPUT, too (this keeps the intention intact to not connect
group inputs to group outputs and vice versa, but allows custom py
defined sockets to connect again) and put it in new utility function.

Maniphest Tasks: T94827

Differential Revision: https://developer.blender.org/D13817
2022-01-14 16:30:59 +01:00
e57365a70b Cleanup split foreach_libblock_remap_callback into smaller functions. 2022-01-14 15:50:42 +01:00
348631cffe Fix: Compilation error caused by missing target relation
bf_nodes/bf_nodes_composite depend on DNA headers
2022-01-14 07:46:00 -07:00
8ae6995e98 Tests: show more precise numbers in benchmark charts 2022-01-14 15:17:22 +01:00
c0d0e2788b Cleanup: compiler warnings with clang 2022-01-14 15:17:22 +01:00
ba48c1ee58 macOS: silence bundle identifier mismatch Xcode warning
Blender.xcodeproj User-supplied CFBundleIdentifier value
'org.blenderfoundation.blender' in the Info.plist must be the same as
the PRODUCT_BUNDLE_IDENTIFIER build setting value ''.

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D13826
2022-01-14 19:33:23 +05:30
6f51cb0ad7 Info.plist: Bump LSMinimumSystemVersion to silence warning
Didn't remove the key-value pair since old Xcode behavior is not
known.

warning: LSMinimumSystemVersion of '10.9.0' is less than the value of
MACOSX_DEPLOYMENT_TARGET '10.13' - setting to '10.13'. (in target
'blender' from project 'Blender')

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D13831
2022-01-14 19:33:06 +05:30
a5cb7c1e62 blenlib/ Any tests: fix self-assignment warning and typo
Fix assignment warning

source/blender/blenlib/tests/BLI_any_test.cc:56:5: warning: explicitly
assigning value of variable of type 'blender::Any<void, 8, 8>'
to itself [-Wself-assign-overloaded]
  c = c;

Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D13835
2022-01-14 19:32:29 +05:30
0cf746c1fa Fix T94878: LineArt crease threshold logic error.
A coding mistake allows default crease to override object crease, now fixed.
2022-01-14 21:43:52 +08:00
c0432d5edb Fix T94089: GPencil Drawing don't Update after paste in Dopesheet
When paste new frames, the datablock need to be tagged to update the drawings.
2022-01-14 13:51:30 +01:00
86b7746e3c Fix T94903: GPencil: Copying keys doesn't preserve Keyframe Type
When a new frame is created, ensure the keytype of source key is used.
2022-01-14 13:05:57 +01:00
0a3de0305c Cleanup: move attribute operators to c++ 2022-01-14 12:53:19 +01:00
c9a8975de5 Fix T94867: viewport render not updating when editing color ramp
The changed node wasn't tagged correctly.
2022-01-14 12:50:53 +01:00
261517e475 Cleanup: Fix warning when compiling without Audaspace 2022-01-14 11:56:02 +01:00
c8e536bac3 Fix T94837: curve tilt on a 2-point-curve is wrong
2-point-curves are treated separately from 3plus-point-curves (assume a
lot of the twisting reduction can be skipped, so there is a dedicated
function for single segment curves).

And while using the 3plus-point-curves function [`make_bevel_list_3D`]
would actually work in this case, the dedicated function
`make_bevel_list_segment_3D` would only consider the tilt of the second
point and would just copy over the quat to the first point as well. Dont
see a reason for this, now consider the first point's tilt as well.

Maniphest Tasks: T94837

Differential Revision: https://developer.blender.org/D13813
2022-01-14 11:26:21 +01:00
e0ac75cb44 Cleanup: Reduce indentation in foreach_libblock_remap_callback. 2022-01-14 09:55:35 +01:00
7c568e7d36 Python API: add "children_recursive" property to Object & Collection
This is a convenience property, already available for bones.

Simplifies D13821 which in-lined this function.
2022-01-14 12:21:56 +11:00
cea588b9ef Cleanup: spelling in comments, C++ style comments for disabled code
Also ensure space at end of comment.
2022-01-14 11:23:46 +11:00
7a0cf2c72f Fix crash caused by exception in Python gizmo target get handler 2022-01-14 10:18:52 +11:00
1bd0a87384 Cleanup: Clang tidy
- modernize-deprecated-headers
- modernize-use-using
- modernize-use-nullptr
- modernize-use-bool-literals
2022-01-13 17:11:38 -06:00
8b3d798374 CMake: add WITH_LINKER_MOLD option for GCC/Clang Unix platforms
Can give considerably faster linking, especially on system with many
cores.

The mold linker recently reached 1.0, see:
https://github.com/rui314/mold

The current stable release of GCC can't use this linker via
-fuse-ld=mold, so this patch uses the "-B" argument to add a binary
directory containing an alternate "ld" command that points to
"mold" (which is part of the default mold installation).

Some timing tests for linking full builds for AMD TR 3970X:

- BFD: 20.78 seconds.
- LLD: 12.16 seconds.
- GOLD: 7.21 seconds.
- MOLD: 2.53 seconds.

Ref D13807

Reviewed by: sergey, brecht
2022-01-14 09:44:58 +11:00
0c5ccae79d Fix: Incorrect logic in mesh validation for removing layers
The mask is only used if it's not zero. Adding the normal mask made
it not zero, but it didn't include anything else, so all custom data
layers except normals were removed. The fix is to only add normals
to the mask when it should be used.
2022-01-13 16:36:50 -06:00
cfa53e0fbe Refactor: Move normals out of MVert, lazy calculation
As described in T91186, this commit moves mesh vertex normals into a
contiguous array of float vectors in a custom data layer, how face
normals are currently stored.

The main interface is documented in `BKE_mesh.h`. Vertex and face
normals are now calculated on-demand and cached, retrieved with an
"ensure" function. Since the logical state of a mesh is now "has
normals when necessary", they can be retrieved from a `const` mesh.

The goal is to use on-demand calculation for all derived data, but
leave room for eager calculation for performance purposes (modifier
evaluation is threaded, but viewport data generation is not).

**Benefits**
This moves us closer to a SoA approach rather than the current AoS
paradigm. Accessing a contiguous `float3` is much more efficient than
retrieving data from a larger struct. The memory requirements for
accessing only normals or vertex locations are smaller, and at the
cost of more memory usage for just normals, they now don't have to
be converted between float and short, which also simplifies code

In the future, the remaining items can be removed from `MVert`,
leaving only `float3`, which has similar benefits (see T93602).

Removing the combination of derived and original data makes it
conceptually simpler to only calculate normals when necessary.
This is especially important now that we have more opportunities
for temporary meshes in geometry nodes.

**Performance**
In addition to the theoretical future performance improvements by
making `MVert == float3`, I've done some basic performance testing
on this patch directly. The data is fairly rough, but it gives an idea
about where things stand generally.
 - Mesh line primitive 4m Verts: 1.16x faster (36 -> 31 ms),
   showing that accessing just `MVert` is now more efficient.
 - Spring Splash Screen: 1.03-1.06 -> 1.06-1.11 FPS, a very slight
   change that at least shows there is no regression.
 - Sprite Fright Snail Smoosh: 3.30-3.40 -> 3.42-3.50 FPS, a small
   but observable speedup.
 - Set Position Node with Scaled Normal: 1.36x faster (53 -> 39 ms),
   shows that using normals in geometry nodes is faster.
 - Normal Calculation 1.6m Vert Cube: 1.19x faster (25 -> 21 ms),
   shows that calculating normals is slightly faster now.
 - File Size of 1.6m Vert Cube: 1.03x smaller (214.7 -> 208.4 MB),
   Normals are not saved in files, which can help with large meshes.

As for memory usage, it may be slightly more in some cases, but
I didn't observe any difference in the production files I tested.

**Tests**
Some modifiers and cycles test results need to be updated with this
commit, for two reasons:
 - The subdivision surface modifier is not responsible for calculating
   normals anymore. In master, the modifier creates different normals
   than the result of the `Mesh` normal calculation, so this is a bug
   fix.
 - There are small differences in the results of some modifiers that
   use normals because they are not converted to and from `short`
   anymore.

**Future improvements**
 - Remove `ModifierTypeInfo::dependsOnNormals`. Code in each modifier
   already retrieves normals if they are needed anyway.
 - Copy normals as part of a better CoW system for attributes.
 - Make more areas use lazy instead of eager normal calculation.
 - Remove `BKE_mesh_normals_tag_dirty` in more places since that is
   now the default state of a new mesh.
 - Possibly apply a similar change to derived face corner normals.

Differential Revision: https://developer.blender.org/D12770
2022-01-13 14:38:25 -06:00
800fc17367 Fix/workaround MSVC compile error with messag-bus
Some of the message-bus macros are not safe to use in C++. This has come
up before, but no good solution was found. Now @LazyDodo, @HooglyBoogly
and I concluded this is the best duct tape "solution" for the moment.
The message-bus API should address this.
2022-01-13 20:40:52 +01:00
1c4a1c13e0 Cleanup: Run make format 2022-01-13 19:56:11 +01:00
5ecaa9a838 Fix compilation error caused by missing target relation
compositor depends on DNA now so that it can access offsets.
2022-01-13 11:34:41 -07:00
3537abe84b Geometry Nodes: Rename String to Curves socket
Today many users seem to think the output from
this node is a single curve with multiple splines.
This patch renames the geometry output socket
from "Curves" to "Curve Instances" to avoid confusion.

Differential Revision: https://developer.blender.org/D13693
2022-01-13 19:17:03 +01:00
743b9c5e1d CMake: fix build issue with gcc+clang-tidy
Precompiled headers are in a compiler specific format,
when using clang-tidy it tries to read the GCC PCH file
and fails at that.

Disable PCH's for now when WITH_CLANG_TIDY is enabled since
a clean work-around doesn't seem readily available.

relevant LLVM/CMake bugs:

https://bugs.llvm.org/show_bug.cgi?id=41579
https://gitlab.kitware.com/cmake/cmake/-/issues/22081

Differential Revision: https://developer.blender.org/D13814

Reviewed by: sergey, Blendify
2022-01-13 09:47:14 -07:00
b8157f5bf1 Fix compilation error caused by missing target relation
Space clip depends on DNA now so that it can access offsets.
2022-01-13 17:25:57 +01:00
22dc865a86 Cleanup: Use nullptr in new Outliner C++ files 2022-01-13 17:01:47 +01:00
039cc32917 Outliner: Compile all Outliner files in C++
We want to refactor quite some of the Outliner code using C++, this is a
logical step to help the transition to a new architecture.

Includes plenty of fixes to make this compile without warnings, trying
not to change logic. The usual stuff (casts from `void *`, designated
initializers, compound literals, etc.).
2022-01-13 17:01:47 +01:00
1a4f8ab389 Cleanup: Make message-bus utility macros callable from C++
C++ doesn't support compound literals like used here (GCC does via an
extension).
2022-01-13 17:01:47 +01:00
f173973ae4 Fix T94874: Drivers using bone custom properties don't work on modifiers 2022-01-13 15:17:32 +01:00
79e985ea54 Cleanup: fix building all geometry nodes in one translation unit
There were a couple of function name collisions which were caused
by sharing code with the mask modifier. I just removed the dependence
on the mask modifier now. The code that I duplicated for that purpose
is only in a legacy node, so it can be expected to be removed soonish.
2022-01-13 12:39:48 +01:00
19a6220308 Fix link errors after recent FFMPEG / link_directories changes 2022-01-13 11:12:56 +01:00
d53738396f Tests: skip some compositor tests when WITH_LIBMV=OFF 2022-01-13 10:41:34 +01:00
7bb572f208 Fix T94737: Cycles wrong normal map normal with OSL
Ensure valid reflection was moved elsewhere, should not be done in the node
anymore.
2022-01-13 10:40:41 +01:00
0cf2fafd81 Fix T94050, T94570, T94527: Cycles Bevel and AO nodes not working with Metal
Workaround what may be a compiler bug, solution found by Michael Jones.
2022-01-13 10:40:41 +01:00
a3deef6fff Fix Cycles CPU + GPU render not using CPU after recent changes
In some places the task scheduler was not initialized in time.
2022-01-13 10:40:41 +01:00
eaa4cdaa42 Fix T94758: wrong denoising albedo with BSSRDF retro reflection 2022-01-13 10:40:40 +01:00
Brecht Van Lommel
29450a2af3 Build: remove usage of link_directories
We are now always using absolute paths for libraries, as recommended by the
CMake docs.

Followup to D9177.
2022-01-13 10:40:38 +01:00
Brecht Van Lommel
75a1a578bd CMake: use FFmpeg find module on Linux
And change install_deps.sh to build shared (instead of static) FFMPEG
libraries, for consistency with other library dependencies and to simplify
the logic. This may require users of install_deps.sh to rebuild FFMPEG.

This is the last step that lets us get rid of LIBPATH variables and
link_directories() entirely, as recommended by the CMake docs.

Some fixes were needed in the find FFMPEG module to make it actually work,
this code was unused up to now.

Followup to D8855.

Differential Revision: https://developer.blender.org/D9177
2022-01-13 10:27:11 +01:00
f1a488d0f2 Fix T92953: Tool Settings: Drag on Tweak fails with LMB select 2022-01-13 14:30:12 +11:00
a7c9fb59ca Cleanup: follow code-style for float suffix 2022-01-13 12:34:28 +11:00
227f0f3582 Cleanup: quiet missing braces warning 2022-01-13 12:33:34 +11:00
97c2c39916 Fix T94624: Object as font instances don't work
The fundamental limitation is that we can only have one instance
("dupli") generator at a time. Because the mesh output of a curve
object is output as an instances, the geometry set instances existed,
replacing the object as font instances. The "fix" is to reverse the
order. The behavior won't be perfect still, but at least the old
behavior will be preserved, which is really what matters for a
feature like this.

One way to take this change further would be completely disabling
regular geometry evaluation while this option is active. However,
it doesn't seem like that would actually improve the state of the code.

Differential Revision: https://developer.blender.org/D13768
2022-01-12 13:46:13 -06:00
a311fa96aa Fix T85706: wm_window_make_drawable update DPI
When drawing windows on monitors that differ in DPI, we can sometimes
have UI elements draw at an incorrect scale. This patch just ensures
that `wm_window_make_drawable` always updates DPI.

See D10483 for more details.

Differential Revision: https://developer.blender.org/D10483

Reviewed by Brecht Van Lommel
2022-01-12 10:37:52 -08:00
e594f23a27 Revert "CMake: use FFmpeg find module on Linux"
This reverts commit 62a0de1673. Linux buildbot
is giving link errors.
2022-01-12 19:07:40 +01:00
fa8c2c7885 Fix T94071: Area Split Improvements
Allow area Split to be initiated in any area and give better feedback
when not allowed.

See D13599 for more details and usage examples.

Differential Revision: https://developer.blender.org/D13599

Reviewed by Campbell Barton
2022-01-12 09:45:19 -08:00
a0dcd0bf2c Fix warnings after bab47b60cb
It's not really clear how this part of the defaults code should be used,
I think this is fine now and solves the warnings.
2022-01-12 18:37:53 +01:00
a72a9e099c Cleanup: Correct indentation 2022-01-12 18:37:53 +01:00
Brecht Van Lommel
62a0de1673 CMake: use FFmpeg find module on Linux
And change install_deps.sh to build shared (instead of static) FFMPEG
libraries, for consistency with other library dependencies and to simplify
the logic. This may require users of install_deps.sh to rebuild FFMPEG.

This is the last step that lets us get rid of LIBPATH variables and
link_directories() entirely, as recommended by the CMake docs.

Some fixes were needed in the find FFMPEG module to make it actually work,
this code was unused up to now.

Followup to D8855.

Differential Revision: https://developer.blender.org/D9177
2022-01-12 18:25:24 +01:00
Simon Lenz
bab47b60cb DNA: Add space clip editor defaults
This is my attempt of adding defaults for the space clip editor struct
(in line with https://developer.blender.org/T80164).

It adds the default allocation for `SpaceClip` and
`node_composite_movieclip.cc`. This also solves the error below (for
C++ files using the DNA_default_alloc), which was put forward by
Sergey Sharybin.

Differential Revision: https://developer.blender.org/D13367

Reviewed by: Julian Eisel
2022-01-12 18:04:48 +01:00
Bastien Montagne
a909ab984c Outliner: Add way to display warning icon for items.
While theorically fairly generic, current code is only enabled for
bledfile and liboverride views, and only used to display messages from
library IDs.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D13766
2022-01-12 18:01:50 +01:00
5f7ad4baaa BLI_math: Fix building when WITH_GMP is off 2022-01-12 17:24:57 +01:00
Nikhil Shringarpurey
e5858a3ad0 Icons: Remove absolute pathnames and deprecated gradients from SVG files
SVG files contained specific detailed pathnames on developers'
computers. These included full local user profile and path and should
not be in the release.

This patches corrects those lines. It also removes unused gradients from
the private icons SVG.

Differential Revision: https://developer.blender.org/D13344

Reviewed by: Yevgeny Makarov, Julian Eisel
2022-01-12 15:03:05 +01:00
ec5560db73 DRW: Add DRW_gpu_wrapper.hh
This adds wrapper classes that make it easier to use GPU objects in C++.

####Motivations:####

 - Easier handling of GPU objects.
 - EEVEE rewrite already makes use of similar wrappers.
 - There is the ongoing effort to use more C++ in the codebase
 and lans to port more engines to it.
 - The shader code refactor will make use of many UBOs with shared
 struct declaration. This helps managing them.
 - Safer handling of `TextureFromPool` which can't be bound as normal
 texture (only texture ref) and can be better tracked in the future.

####Considerations:####

 - I chose the `blender::draw` namespace because `blender::gpu` already has private classes (i.e: `gpu::Texture`).
 - Theses are wrappers that manage a GPU object internally. They might be confused with actual `Texture`. However, the name `TextureWrapper` is a bit too much verbose in my opinion. I'm open to suggestion about better name.

Reviewed By: jbakker

Differential Revision: http://developer.blender.org/D13805
2022-01-12 13:05:18 +01:00
0882069095 Cleanup: codestyle obj_exporter_tests.cc. 2022-01-12 13:02:28 +01:00
1552b86b55 Cleanup: Not needed if statement around delete. 2022-01-12 13:02:28 +01:00
d43b5791e0 BLI: Refactor vector types & functions to use templates
This patch implements the vector types (i.e:`float2`) by making heavy
usage of templating. All vector functions are now outside of the vector
classes (inside the `blender::math` namespace) and are not vector size
dependent for the most part.

In the ongoing effort to make shaders less GL centric, we are aiming
to share more code between GLSL and C++ to avoid code duplication.

####Motivations:
- We are aiming to share UBO and SSBO structures between GLSL and C++.
This means we will use many of the existing vector types and others
we currently don't have (uintX, intX). All these variations were
asking for many more code duplication.
- Deduplicate existing code which is duplicated for each vector size.
- We also want to share small functions. Which means that vector
functions should be static and not in the class namespace.
- Reduce friction to use these types in new projects due to their
incompleteness.
- The current state of the `BLI_(float|double|mpq)(2|3|4).hh` is a
bit of a let down. Most clases are incomplete, out of sync with each
others with different codestyles, and some functions that should be
static are not (i.e: `float3::reflect()`).

####Upsides:
- Still support `.x, .y, .z, .w` for readability.
- Compact, readable and easilly extendable.
- All of the vector functions are available for all the vectors types
and can be restricted to certain types. Also template specialization
let us define exception for special class (like mpq).
- With optimization ON, the compiler unroll the loops and performance
is the same.

####Downsides:
- Might impact debugability. Though I would arge that the bugs are
rarelly caused by the vector class itself (since the operations are
quite trivial) but by the type conversions.
- Might impact compile time. I did not saw a significant impact since
the usage is not really widespread.
- Functions needs to be rewritten to support arbitrary vector length.
For instance, one can't call `len_squared_v3v3` in
`math::length_squared()` and call it a day.
- Type cast does not work with the template version of the `math::`
vector functions. Meaning you need to manually cast `float *` and
`(float *)[3]` to `float3` for the function calls.
i.e: `math::distance_squared(float3(nearest.co), positions[i]);`
- Some parts might loose in readability:
`float3::dot(v1.normalized(), v2.normalized())`
becoming
`math::dot(math::normalize(v1), math::normalize(v2))`
But I propose, when appropriate, to use
`using namespace blender::math;` on function local or file scope to
increase readability.
`dot(normalize(v1), normalize(v2))`

####Consideration:
- Include back `.length()` method. It is quite handy and is more C++
oriented.
- I considered the GLM library as a candidate for replacement. It felt
like too much for what we need and would be difficult to extend / modify
to our needs.
- I used Macros to reduce code in operators declaration and potential
copy paste bugs. This could reduce debugability and could be reverted.
- This touches `delaunay_2d.cc` and the intersection code. I would like
to know @howardt opinion on the matter.
- The `noexcept` on the copy constructor of `mpq(2|3)` is being removed.
But according to @JacquesLucke it is not a real problem for now.

I would like to give a huge thanks to @JacquesLucke who helped during this
and pushed me to reduce the duplication further.

Reviewed By: brecht, sergey, JacquesLucke

Differential Revision: https://developer.blender.org/D13791
2022-01-12 12:57:07 +01:00
fb6bd88644 Revert "BLI: Refactor vector types & functions to use templates"
Includes unwanted changes

This reverts commit 46e049d0ce.
2022-01-12 12:50:02 +01:00
Clment Foucault
46e049d0ce BLI: Refactor vector types & functions to use templates
This patch implements the vector types (i.e:`float2`) by making heavy
usage of templating. All vector functions are now outside of the vector
classes (inside the `blender::math` namespace) and are not vector size
dependent for the most part.

In the ongoing effort to make shaders less GL centric, we are aiming
to share more code between GLSL and C++ to avoid code duplication.

####Motivations:
 - We are aiming to share UBO and SSBO structures between GLSL and C++.
 This means we will use many of the existing vector types and others
 we currently don't have (uintX, intX). All these variations were
 asking for many more code duplication.
 - Deduplicate existing code which is duplicated for each vector size.
 - We also want to share small functions. Which means that vector
 functions should be static and not in the class namespace.
 - Reduce friction to use these types in new projects due to their
 incompleteness.
 - The current state of the `BLI_(float|double|mpq)(2|3|4).hh` is a
 bit of a let down. Most clases are incomplete, out of sync with each
 others with different codestyles, and some functions that should be
 static are not (i.e: `float3::reflect()`).

####Upsides:
 - Still support `.x, .y, .z, .w` for readability.
 - Compact, readable and easilly extendable.
 - All of the vector functions are available for all the vectors types
 and can be restricted to certain types. Also template specialization
 let us define exception for special class (like mpq).
 - With optimization ON, the compiler unroll the loops and performance
 is the same.

####Downsides:
 - Might impact debugability. Though I would arge that the bugs are
 rarelly caused by the vector class itself (since the operations are
 quite trivial) but by the type conversions.
 - Might impact compile time. I did not saw a significant impact since
 the usage is not really widespread.
 - Functions needs to be rewritten to support arbitrary vector length.
 For instance, one can't call `len_squared_v3v3` in
 `math::length_squared()` and call it a day.
 - Type cast does not work with the template version of the `math::`
 vector functions. Meaning you need to manually cast `float *` and
 `(float *)[3]` to `float3` for the function calls.
 i.e: `math::distance_squared(float3(nearest.co), positions[i]);`
 - Some parts might loose in readability:
 `float3::dot(v1.normalized(), v2.normalized())`
 becoming
 `math::dot(math::normalize(v1), math::normalize(v2))`
 But I propose, when appropriate, to use
 `using namespace blender::math;` on function local or file scope to
 increase readability.
 `dot(normalize(v1), normalize(v2))`

####Consideration:
 - Include back `.length()` method. It is quite handy and is more C++
 oriented.
 - I considered the GLM library as a candidate for replacement. It felt
 like too much for what we need and would be difficult to extend / modify
 to our needs.
 - I used Macros to reduce code in operators declaration and potential
 copy paste bugs. This could reduce debugability and could be reverted.
 - This touches `delaunay_2d.cc` and the intersection code. I would like
 to know @howardt opinion on the matter.
 - The `noexcept` on the copy constructor of `mpq(2|3)` is being removed.
 But according to @JacquesLucke it is not a real problem for now.

I would like to give a huge thanks to @JacquesLucke who helped during this
and pushed me to reduce the duplication further.

Reviewed By: brecht, sergey, JacquesLucke

Differential Revision: https://developer.blender.org/D13791
2022-01-12 12:47:43 +01:00
e5766752d0 Revert "BLI: Refactor vector types & functions to use templates"
Reverted because the commit removes a lot of commits.

This reverts commit a2c1c368af.
2022-01-12 12:44:26 +01:00
Nathan Rozendaal
b2ccd8546c Compositor: Add Scene Time Node, Rename Time node
Fixes issue T94603
It adds a new compositor node called Scene Time which is already present as a geo node, having the same basic nodes available in all node trees is a nice thing to have.
Renames "Time" node to "Time Curve", this is done to avoid confusion between the Time node and the Scene Time node.

Reviewed By: jbakker

Maniphest Tasks: T94603

Differential Revision: https://developer.blender.org/D13762
2022-01-12 12:29:44 +01:00
a2c1c368af BLI: Refactor vector types & functions to use templates
This patch implements the vector types (i.e:float2) by making heavy
usage of templating. All vector functions are now outside of the vector
classes (inside the blender::math namespace) and are not vector size
dependent for the most part.

In the ongoing effort to make shaders less GL centric, we are aiming
to share more code between GLSL and C++ to avoid code duplication.

Motivations:
- We are aiming to share UBO and SSBO structures between GLSL and C++.
  This means we will use many of the existing vector types and others we
  currently don't have (uintX, intX). All these variations were asking
  for many more code duplication.
- Deduplicate existing code which is duplicated for each vector size.
- We also want to share small functions. Which means that vector functions
  should be static and not in the class namespace.
- Reduce friction to use these types in new projects due to their
  incompleteness.
- The current state of the BLI_(float|double|mpq)(2|3|4).hh is a bit of a
  let down. Most clases are incomplete, out of sync with each others with
  different codestyles, and some functions that should be static are not
  (i.e: float3::reflect()).

Upsides:
- Still support .x, .y, .z, .w for readability.
- Compact, readable and easilly extendable.
- All of the vector functions are available for all the vectors types and
  can be restricted to certain types. Also template specialization let us
  define exception for special class (like mpq).
- With optimization ON, the compiler unroll the loops and performance is
  the same.

Downsides:
- Might impact debugability. Though I would arge that the bugs are rarelly
  caused by the vector class itself (since the operations are quite trivial)
  but by the type conversions.
- Might impact compile time. I did not saw a significant impact since the
  usage is not really widespread.
- Functions needs to be rewritten to support arbitrary vector length. For
  instance, one can't call len_squared_v3v3 in math::length_squared() and
  call it a day.
- Type cast does not work with the template version of the math:: vector
  functions. Meaning you need to manually cast float * and (float *)[3] to
  float3 for the function calls.
  i.e: math::distance_squared(float3(nearest.co), positions[i]);
- Some parts might loose in readability:
  float3::dot(v1.normalized(), v2.normalized())
  becoming
  math::dot(math::normalize(v1), math::normalize(v2))
  But I propose, when appropriate, to use
  using namespace blender::math; on function local or file scope to
  increase readability. dot(normalize(v1), normalize(v2))

Consideration:
- Include back .length() method. It is quite handy and is more C++
  oriented.
- I considered the GLM library as a candidate for replacement.
  It felt like too much for what we need and would be difficult to
  extend / modify to our needs.
- I used Macros to reduce code in operators declaration and potential
  copy paste bugs. This could reduce debugability and could be reverted.
- This touches delaunay_2d.cc and the intersection code. I would like to
  know @Howard Trickey (howardt) opinion on the matter.
- The noexcept on the copy constructor of mpq(2|3) is being removed.
  But according to @Jacques Lucke (JacquesLucke) it is not a real problem
  for now.

I would like to give a huge thanks to @Jacques Lucke (JacquesLucke) who
helped during this and pushed me to reduce the duplication further.

Reviewed By: brecht, sergey, JacquesLucke

Differential Revision: http://developer.blender.org/D13791
2022-01-12 12:19:39 +01:00
d320f3677e Cleanup: make format 2022-01-12 11:29:18 +01:00
d6e65e55a6 Merge branch 'master' into greasepencil-object 2021-12-27 19:31:18 +01:00
11b888bcd8 Merge branch 'master' into greasepencil-object 2021-12-22 16:17:18 +01:00
834db68159 Merge branch 'master' into greasepencil-object 2021-11-16 15:49:10 +01:00
8c09467a32 Merge branch 'master' into greasepencil-object 2021-10-27 13:32:40 +02:00
ea5bc27874 Merge branch 'master' into greasepencil-object 2021-10-22 17:01:14 +02:00
8bf4c22160 Merge branch 'master' into greasepencil-object 2021-10-07 16:16:23 +02:00
98925e960c Merge branch 'master' into greasepencil-object 2021-09-28 10:09:34 +02:00
99db465917 Merge branch 'master' into greasepencil-object 2021-09-22 15:56:51 +02:00
9e9dc5574b Merge branch 'master' into greasepencil-object 2021-09-15 15:34:49 +02:00
9b5c2b6411 Merge branch 'master' into greasepencil-object 2021-09-07 15:51:14 +02:00
f0326c5ea0 Merge branch 'master' into greasepencil-object 2021-09-03 15:31:37 +02:00
575f6bc942 Merge branch 'master' into greasepencil-object 2021-08-31 15:03:34 +02:00
43c66413ab Merge branch 'master' into greasepencil-object 2021-08-26 15:42:19 +02:00
556d31d7e7 Merge branch 'master' into greasepencil-object 2021-08-23 22:29:43 +02:00
c343fd9a27 Merge branch 'master' into greasepencil-object 2021-08-19 19:24:05 +02:00
4cee10f448 Merge branch 'master' into greasepencil-object 2021-08-19 17:08:24 +02:00
052a4989b0 Merge branch 'master' into greasepencil-object 2021-08-17 13:48:36 +02:00
60b23631bd Merge branch 'master' into greasepencil-object 2021-08-13 10:38:00 +02:00
7b6cfb50e9 Merge branch 'master' into greasepencil-object 2021-08-08 14:58:50 +02:00
2eb99513ed Merge branch 'master' into greasepencil-object 2021-08-06 15:30:20 +02:00
899691e9f4 Merge branch 'master' into greasepencil-object 2021-08-05 17:23:09 +02:00
f3c1e76a14 Merge branch 'master' into greasepencil-object 2021-08-04 16:05:25 +02:00
d6bdef750e Merge branch 'master' into greasepencil-object 2021-08-02 11:06:03 +02:00
75f8b2bbcd Merge branch 'master' into greasepencil-object 2021-07-29 22:31:16 +02:00
240c124bc8 Merge branch 'master' into greasepencil-object 2021-07-22 15:50:51 +02:00
8bac8f895c Merge branch 'master' into greasepencil-object 2021-07-14 11:11:31 +02:00
e4fa94a3d5 Merge branch 'master' into greasepencil-object 2021-07-11 18:55:44 +02:00
ea8828227d Merge branch 'master' into greasepencil-object 2021-07-06 22:21:06 +02:00
c1fc19ab72 Merge branch 'master' into greasepencil-object 2021-07-03 17:41:36 +02:00
abbedc5242 Merge branch 'master' into greasepencil-object 2021-07-02 12:05:34 +02:00
1036c5f34f Merge branch 'master' into greasepencil-object 2021-06-28 22:12:01 +02:00
c7253a52aa Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
2021-06-28 19:44:15 +02:00
5a901b2640 Merge branch 'master' into greasepencil-object 2021-06-25 15:33:52 +02:00
f0cb1f77e7 Merge branch 'master' into greasepencil-object 2021-06-23 17:30:44 +02:00
561e67d020 Merge branch 'master' into greasepencil-object 2021-06-23 16:44:13 +02:00
cb1c6248fe Merge branch 'master' into greasepencil-object 2021-06-21 17:29:55 +02:00
88c3a3254c Merge branch 'master' into greasepencil-object 2021-06-19 10:48:15 +02:00
b70273d4a3 Merge branch 'master' into greasepencil-object 2021-06-09 17:03:05 +02:00
38cb90fbd3 GPencil: Second test of thin lines 2021-06-09 16:11:03 +02:00
2f47c36559 Merge branch 'master' into greasepencil-object 2021-06-08 11:15:27 +02:00
2508e89ddb Merge branch 'master' into greasepencil-object 2021-06-06 16:03:13 +02:00
4816ee10b6 Merge branch 'master' into greasepencil-object 2021-06-04 10:47:13 +02:00
02d28d2e21 GPencil: Test very thin lines 2021-06-02 18:15:59 +02:00
1c10624ff9 Merge branch 'master' into greasepencil-object 2021-06-02 16:47:36 +02:00
73e342285c Merge branch 'master' into greasepencil-object 2021-05-31 17:05:18 +02:00
c88c5d376e Merge branch 'master' into greasepencil-object 2021-05-28 19:12:43 +02:00
f086542efa Merge branch 'master' into greasepencil-object 2021-05-26 15:46:37 +02:00
d9c9f3c3be Merge branch 'master' into greasepencil-object 2021-05-26 12:44:31 +02:00
d78e22b352 Merge branch 'master' into greasepencil-object 2021-05-25 17:23:06 +02:00
760ff46a81 Merge branch 'master' into greasepencil-object 2021-05-24 12:48:52 +02:00
ab481cf97b Merge branch 'master' into greasepencil-object 2021-05-21 15:49:27 +02:00
58cca3d9d0 Merge branch 'master' into greasepencil-object 2021-05-20 20:19:03 +02:00
f89ef8d088 Merge branch 'master' into greasepencil-object 2021-05-18 17:49:52 +02:00
ff2f769ee2 Merge branch 'master' into greasepencil-object 2021-05-17 19:17:46 +02:00
1573c5fa90 Merge branch 'master' into greasepencil-object 2021-05-14 18:04:57 +02:00
ac1157b5fb Merge branch 'master' into greasepencil-object 2021-05-07 18:28:34 +02:00
19f36e16e8 GPencil: Fix wrong order when Append layers to Object
The operator was using the active layer as position to add new layer. Now the operator verify is using the last layer to make it at end.
2021-05-07 16:34:38 +02:00
f5077f7428 Merge branch 'master' into greasepencil-object 2021-05-07 15:50:20 +02:00
309ee7d926 GPencil: Fix wrong variable for props 2021-05-06 19:59:58 +02:00
317a2e6540 GPencil: Append Layer for Active or All layers 2021-05-06 19:12:41 +02:00
22944ea91e GPencil: Remove duplicated code and cleanup 2021-05-06 18:59:09 +02:00
1cc82b5099 GPencil: Fix typo error 2021-05-06 17:29:04 +02:00
c94558c30a GPencil: Add option to append only active material 2021-05-06 17:25:55 +02:00
cd31dd5120 Merge branch 'master' into greasepencil-object 2021-05-06 16:50:23 +02:00
2542868ccd GPencil: Check if original Object has materials to append 2021-05-05 16:13:21 +02:00
f12fad3957 GPencil: Simplify Poll function 2021-05-05 15:52:25 +02:00
00f2e43149 GPencil: New operator to Append materials into new object
This is a production request to be able to append all materials of one object into another object.
2021-05-04 19:33:43 +02:00
444a881f94 Merge branch 'master' into greasepencil-object 2021-05-04 16:47:26 +02:00
81d2a5f310 GPencil: UI Swap Leak Size and new Dilate param
The leak size is less used than new dilate and is better put this in the top bar.
2021-05-04 16:18:34 +02:00
e05ef9e607 Merge branch 'master' into greasepencil-object 2021-05-04 15:56:08 +02:00
dd20d226a0 GPencil: Add new Dilate factor for Fill Brush
Before, the dilate of the fill area was predefined as 1 pixel. Now this value can be changed to fill gaps.
2021-04-29 20:04:30 +02:00
ee52ae3fd2 GPencil: Dilate more the filling area
This is a text for small pixel gaps in complex areas
2021-04-29 16:26:43 +02:00
fee6605518 Merge branch 'master' into greasepencil-object 2021-04-29 16:17:47 +02:00
cd06f3646e Merge branch 'master' into greasepencil-object 2021-04-29 15:49:27 +02:00
199eeeeed3 Merge branch 'master' into greasepencil-object 2021-04-28 17:35:33 +02:00
a8ccdc16aa Merge branch 'master' into greasepencil-object 2021-04-27 17:41:53 +02:00
4838270760 Merge branch 'master' into greasepencil-object 2021-04-25 18:50:20 +02:00
e0f041c4dd Merge branch 'master' into greasepencil-object 2021-04-22 09:37:32 +02:00
3d683beecc Merge branch 'master' into greasepencil-object 2021-04-17 15:45:47 +02:00
e32f676e4f Merge branch 'master' into greasepencil-object 2021-04-14 16:08:11 +02:00
77b498493e Merge branch 'master' into greasepencil-object 2021-04-13 17:21:00 +02:00
7a69b15fc8 Merge branch 'master' into greasepencil-object 2021-04-12 13:36:08 +02:00
678fa3a530 Merge branch 'master' into greasepencil-object 2021-04-11 13:30:29 +02:00
bcb2beb46a Merge branch 'master' into greasepencil-object 2021-04-09 10:43:30 +02:00
3a8b557929 Merge branch 'master' into greasepencil-object 2021-04-07 15:38:23 +02:00
0a57a8d2e5 Merge branch 'master' into greasepencil-object 2021-04-01 17:39:15 +02:00
6fd6d5f4f3 Merge branch 'master' into greasepencil-object 2021-03-30 10:01:17 +02:00
c64192997f Merge branch 'master' into greasepencil-object 2021-03-29 17:09:33 +02:00
c7db7b0d15 Merge branch 'master' into greasepencil-object 2021-03-27 15:03:35 +01:00
afafe8d2a5 Merge branch 'master' into greasepencil-object 2021-03-26 17:35:49 +01:00
85fb1cbbc7 Merge branch 'master' into greasepencil-object 2021-03-25 16:23:25 +01:00
d4b4a8c95e Merge branch 'master' into greasepencil-object 2021-03-24 17:10:18 +01:00
72382baea8 GPencil: Undo any difference with master
This keeps the branch equal ready for new developments and tests.
2021-03-24 17:09:32 +01:00
a8144e857b GPencil: Revert change of temp buffer size
Related to spray test
2021-03-24 17:08:33 +01:00
b847c1f959 GPencil: Revert change in Layer selector popup 2021-03-24 17:08:00 +01:00
43416a6145 GPencil: Remove Spread effect
This was a test for spay brush
2021-03-24 17:06:47 +01:00
d4067bc8a7 GPencil: Fix merge errors 2021-03-24 16:22:37 +01:00
e002ad1748 Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/space_topbar.py
	source/blender/blenkernel/BKE_gpencil_geom.h
	source/blender/blenkernel/intern/gpencil_geom.c
	source/blender/editors/gpencil/gpencil_utils.c
	source/blender/editors/include/ED_gpencil.h
	source/blender/editors/io/CMakeLists.txt
	source/blender/editors/io/io_gpencil.h
	source/blender/editors/io/io_gpencil_export.c
	source/blender/editors/io/io_gpencil_import.c
	source/blender/editors/io/io_gpencil_utils.c
	source/blender/editors/io/io_ops.c
	source/blender/io/CMakeLists.txt
	source/blender/io/gpencil/CMakeLists.txt
	source/blender/io/gpencil/gpencil_io.h
	source/blender/io/gpencil/intern/gpencil_io_base.cc
	source/blender/io/gpencil/intern/gpencil_io_base.h
	source/blender/io/gpencil/intern/gpencil_io_capi.cc
	source/blender/io/gpencil/intern/gpencil_io_export_base.h
	source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc
	source/blender/io/gpencil/intern/gpencil_io_export_pdf.h
	source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
	source/blender/io/gpencil/intern/gpencil_io_export_svg.h
	source/blender/io/gpencil/intern/gpencil_io_import_base.cc
	source/blender/io/gpencil/intern/gpencil_io_import_base.h
	source/blender/io/gpencil/intern/gpencil_io_import_svg.cc
	source/blender/io/gpencil/intern/gpencil_io_import_svg.h
	source/blender/io/gpencil/nanosvg/nanosvg.h
2021-03-24 16:06:17 +01:00
611c1b09c0 Merge branch 'master' into greasepencil-object 2021-03-23 15:51:52 +01:00
de4bebe670 Merge branch 'master' into greasepencil-object 2021-03-21 10:29:00 +01:00
706e4a7241 Merge branch 'master' into greasepencil-object 2021-03-19 18:21:55 +01:00
f7ec3622ea Merge branch 'master' into greasepencil-object 2021-03-17 09:20:57 +01:00
a59f905f86 Merge branch 'master' into greasepencil-object 2021-03-13 13:30:03 +01:00
3134e96b1e Merge branch 'master' into greasepencil-object 2021-03-12 17:01:50 +01:00
e05e6a86d3 GPencil: Test multiple Lattice modifiers 2021-03-11 14:07:07 +01:00
787ab63fc2 Merge branch 'master' into greasepencil-object 2021-03-11 09:53:24 +01:00
16379630f3 Merge branch 'master' into greasepencil-object 2021-03-08 15:46:27 +01:00
ecde731cf1 Merge branch 'master' into greasepencil-object 2021-03-05 19:18:31 +01:00
f4524da364 Merge branch 'master' into greasepencil-object 2021-03-04 21:37:27 +01:00
19f08b170b Merge branch 'master' into greasepencil-object 2021-03-03 11:18:11 +01:00
cbcedd382a GPencil: Rever Dopesheet bar UI test 2021-03-02 20:48:04 +01:00
988d953c89 Merge branch 'master' into greasepencil-object 2021-03-01 16:40:18 +01:00
98be367997 GPencil: Test Dopesheet bar shorter
This is to test a new UI design for bar between keyframes
2021-02-28 13:11:17 +01:00
61afd120e0 Merge branch 'master' into greasepencil-object 2021-02-28 12:46:56 +01:00
c76345f922 Merge branch 'master' into greasepencil-object 2021-02-25 15:43:08 +01:00
105f716699 Merge branch 'master' into greasepencil-object 2021-02-24 16:05:43 +01:00
361c549b79 Merge branch 'master' into greasepencil-object 2021-02-23 16:28:32 +01:00
e049ee57dd Merge branch 'master' into greasepencil-object 2021-02-22 19:26:30 +01:00
afe53dfc6d Merge branch 'master' into greasepencil-object 2021-02-20 15:34:59 +01:00
25a1840bac Merge branch 'master' into greasepencil-object 2021-02-19 17:42:10 +01:00
952c627697 Merge branch 'master' into greasepencil-object 2021-02-17 16:16:19 +01:00
9eab14b016 Merge branch 'master' into greasepencil-object 2021-02-16 12:57:43 +01:00
6b83904271 Merge branch 'master' into greasepencil-object 2021-02-12 15:26:11 +01:00
cccc957be2 Merge branch 'master' into greasepencil-object 2021-02-11 17:23:32 +01:00
aaea803b22 Merge branch 'master' into greasepencil-object 2021-02-10 15:49:35 +01:00
91f3ac200b Merge branch 'master' into greasepencil-object 2021-02-09 16:19:57 +01:00
aafe4d808f Merge branch 'master' into greasepencil-object 2021-02-07 13:10:41 +01:00
898e29941e GPencil: Fix typo error in Cmake 2021-02-02 12:37:53 +01:00
3174f87d86 GPencil: Fix errors after include Haru library 2021-02-02 12:18:15 +01:00
3ff0a8c580 Merge branch 'master' into greasepencil-object
Conflicts:
	build_files/cmake/platform/platform_win32.cmake
2021-02-02 10:58:35 +01:00
dab0d01535 Merge branch 'master' into greasepencil-object 2021-02-01 11:06:31 +01:00
540ffad874 Merge branch 'master' into greasepencil-object 2021-01-30 16:18:15 +01:00
e547a7ecd3 Merge branch 'master' into greasepencil-object 2021-01-28 16:38:01 +01:00
3d48412fff Merge branch 'master' into greasepencil-object 2021-01-25 16:13:40 +01:00
9e0b809807 Merge branch 'master' into greasepencil-object 2021-01-21 16:13:36 +01:00
e353d86710 Merge branch 'master' into greasepencil-object 2021-01-20 13:12:07 +01:00
c221a82828 Merge branch 'master' into greasepencil-object 2021-01-19 17:38:42 +01:00
9cb672d8c1 Merge branch 'master' into greasepencil-object 2021-01-18 16:00:29 +01:00
b3338f900c GPencil: Use Layer Transform in Export to SVG and PDF
Also, removed a double calculation of the layer transform matrix.
2021-01-17 13:07:20 +01:00
6afde1a3c7 Merge branch 'master' into greasepencil-object 2021-01-17 12:35:55 +01:00
2c323dc875 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/editors/include/ED_gpencil.h
2021-01-16 17:01:03 +01:00
236577f8f3 GPencil: Fix errors after merge 2021-01-16 16:11:48 +01:00
1df7b6a2f4 Merge branch 'master' into greasepencil-object 2021-01-16 16:06:03 +01:00
fbd9cff2ad GPencil: Filter hidden materials when export to SVG or PDF 2021-01-16 13:04:09 +01:00
a9e902da05 Merge branch 'master' into greasepencil-object 2021-01-14 22:31:10 +01:00
10cf313e8e Merge branch 'master' into greasepencil-object 2021-01-14 15:10:24 +01:00
04e2dd49dd GPencil: Spread option removed
This was an experimental feature and the result is not what we expected.
2021-01-14 15:09:42 +01:00
370e4a944d Merge branch 'master' into greasepencil-object 2021-01-13 10:59:20 +01:00
bb2e23af7c Merge branch 'master' into greasepencil-object 2021-01-11 15:42:52 +01:00
6740bbb39b Merge branch 'master' into greasepencil-object 2021-01-08 16:10:54 +01:00
e01fb74314 Merge branch 'master' into greasepencil-object 2021-01-05 17:17:35 +01:00
5c04cd1e5e Merge branch 'master' into greasepencil-object 2021-01-04 10:26:18 +01:00
b25ef49100 Merge branch 'master' into greasepencil-object 2021-01-01 11:48:03 +01:00
431446caef Merge branch 'master' into greasepencil-object 2020-12-29 10:27:09 +01:00
8ffdf35310 Merge branch 'master' into greasepencil-object 2020-12-28 16:04:38 +01:00
33d38c1a66 Merge branch 'master' into greasepencil-object 2020-12-27 19:17:52 +01:00
c95b31df83 GPencil: Don't normalize strokes by default exporting PDF
If the stroke is normalized by default there are gaps.
2020-12-25 16:05:19 +01:00
353a254e39 Merge branch 'master' into greasepencil-object 2020-12-25 15:50:37 +01:00
1bfe241038 Merge branch 'master' into greasepencil-object 2020-12-24 16:00:56 +01:00
97b91730cb Merge branch 'master' into greasepencil-object 2020-12-23 16:32:56 +01:00
d035044212 Merge branch 'master' into greasepencil-object 2020-12-22 19:02:35 +01:00
b472c78285 Merge branch 'master' into greasepencil-object 2020-12-21 12:14:20 +01:00
6992cd3a9d Merge branch 'master' into greasepencil-object 2020-12-18 19:02:49 +01:00
32bab9cf9e GPencil: Fix merge problems
There were some changes in the include files
2020-12-18 19:01:38 +01:00
b616e74de3 Merge branch 'master' into greasepencil-object 2020-12-17 16:06:18 +01:00
7a5d1cb9d5 Merge branch 'master' into greasepencil-object 2020-12-16 15:46:20 +01:00
c4fc0bc7e3 Merge branch 'master' into greasepencil-object 2020-12-15 22:31:28 +01:00
cd3b8047c3 Merge branch 'master' into greasepencil-object 2020-12-15 17:15:25 +01:00
eb15d250a9 Merge branch 'master' into greasepencil-object 2020-12-15 17:01:26 +01:00
c063d08a13 Merge branch 'master' into greasepencil-object 2020-12-14 10:56:19 +01:00
9b469ee9d0 GPencil: Fix merge error 2020-12-12 19:02:50 +01:00
39a4200ddb Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenkernel/BKE_gpencil_geom.h
	source/blender/blenkernel/intern/gpencil_geom.c
2020-12-12 18:55:57 +01:00
59beecd4f7 GPencil: Revert wrongly changed variable type for flag
This was changed by error in previous commit
2020-12-12 12:54:14 +01:00
1e448183a1 GPencil: Replace uint32 with int32
According to style, negative must be checked with asserts.
2020-12-12 12:52:40 +01:00
8aa7b2c9c5 GPencil: Change CMake include to singular 2020-12-11 16:46:06 +01:00
cc58d49f10 GPencil: Fix CMake typo error 2020-12-11 16:41:17 +01:00
958841259c Merge branch 'master' into greasepencil-object 2020-12-11 15:57:44 +01:00
bedd010285 Merge branch 'master' into greasepencil-object 2020-12-10 15:47:58 +01:00
9fd65fe8d4 GPencil: Fix Cmake for Windows for libharu
This is hardcoded now
2020-12-09 16:42:43 +01:00
c25814d6f3 Merge branch 'master' into greasepencil-object 2020-12-09 15:48:07 +01:00
920edc330d GPencil: Add paths for libharu for cmake 2020-12-09 13:57:11 +01:00
3b461a8b43 Merge branch 'master' into greasepencil-object 2020-12-09 09:41:48 +01:00
7fdb25c0e0 Merge branch 'master' into greasepencil-object 2020-12-08 16:50:44 +01:00
7068b487ee Merge branch 'master' into greasepencil-object 2020-12-07 19:46:19 +01:00
1bd1536288 Merge branch 'master' into greasepencil-object 2020-12-07 18:35:40 +01:00
9b5d23b124 Merge branch 'greasepencil-io' into greasepencil-object
WARNING: This branch only can be compiled with libharu. I have a windows version and we are working in the Linux version, but the installation of the library must be done manually.
2020-12-07 18:29:51 +01:00
e22ee0c470 Merge branch 'greasepencil-object' into greasepencil-io 2020-12-05 14:06:59 +01:00
2c0128d06f Merge branch 'master' into greasepencil-object 2020-12-05 14:06:03 +01:00
33a5bf1dcd GPencil: Cleanup double points
No functional changes.
2020-12-04 18:02:44 +01:00
7655d5abb7 Merge branch 'greasepencil-object' into greasepencil-io 2020-12-04 17:37:02 +01:00
29785dd513 Merge branch 'master' into greasepencil-object 2020-12-04 17:35:03 +01:00
e003e664c4 Merge branch 'greasepencil-object' into greasepencil-io 2020-12-03 17:21:01 +01:00
3b6dc7d3cf Merge branch 'master' into greasepencil-object 2020-12-03 17:18:50 +01:00
5fb559243e Merge branch 'greasepencil-object' into greasepencil-io 2020-12-03 16:52:28 +01:00
3934b6a926 Merge branch 'master' into greasepencil-object 2020-12-03 16:51:15 +01:00
2dfaaddd58 Merge branch 'greasepencil-object' into greasepencil-io 2020-12-02 18:48:08 +01:00
f18a656d94 Merge branch 'master' into greasepencil-object 2020-12-02 18:47:27 +01:00
9e0236ee25 Merge branch 'greasepencil-object' into greasepencil-io 2020-12-02 12:57:58 +01:00
a69947ca69 Merge branch 'master' into greasepencil-object
Conflicts:
	build_files/cmake/platform/platform_unix.cmake
2020-12-02 12:52:03 +01:00
b6ce0b05a5 GPencil: Fix error after inlude PugiXML lib
The name of the include dir changed.
2020-12-01 16:34:41 +01:00
ef5b7858e7 Merge branch 'greasepencil-object' into greasepencil-io 2020-12-01 16:19:11 +01:00
b7f7b5bb39 Merge branch 'master' into greasepencil-object
Conflicts:
	build_files/cmake/platform/platform_win32.cmake
2020-12-01 16:17:49 +01:00
5a1ab02cb1 GPencil: Rename frame mode and select mode 2020-11-27 17:56:53 +01:00
8f73ad51e6 GPencil: Cleanup extra blanks 2020-11-27 17:46:30 +01:00
d93065bd71 GPencil: Cleanup params struct values 2020-11-27 17:42:37 +01:00
4875f50df9 GPencil: Remove subfix_ parameter
This was used by old SVG Storyboards
2020-11-27 17:19:41 +01:00
88f17b9520 GPencil: Remove frame_box_
This was used by old SVG storyboards
2020-11-27 17:09:32 +01:00
35494cdcc0 GPencil: Remove frame_ratio_
This was used by old SVG storyboards
2020-11-27 17:06:19 +01:00
18b7952fc5 GPencil: Remove unused frame_offset_
This was used by old storyboards in SVG
2020-11-27 17:04:01 +01:00
2347cc2a07 GPencil: Cleanup includes 2020-11-27 16:59:19 +01:00
e986bc9140 GPencil: More const attribute 2020-11-27 16:28:31 +01:00
6d985de1cb GPencil: Cleanup - Add const to variables 2020-11-27 16:23:17 +01:00
2fe5910688 Merge branch 'greasepencil-object' into greasepencil-io 2020-11-27 16:10:50 +01:00
dd97610eab Merge branch 'master' into greasepencil-object 2020-11-27 16:10:09 +01:00
867feff109 GPencil: Cleanup unused includes 2020-11-26 22:02:30 +01:00
5cbb48d072 GPencil: Remove duplicate page size parameter 2020-11-26 21:56:23 +01:00
45d1367485 GPencil: More cleanup 2020-11-26 17:23:38 +01:00
3f26b7c75b GPencil: Cleanup - rename function 2020-11-26 17:21:54 +01:00
20396cb1b8 GPencil: Rename setters name 2020-11-26 17:19:13 +01:00
c0f84894a2 GPencil: Remove unused variable for paper sizes 2020-11-26 16:58:42 +01:00
a0e10095c0 GPencil: Move libharu to lib folder
The lib must be in lib subfolder not in libharu root folder
2020-11-26 16:39:14 +01:00
d86965c85a Merge branch 'greasepencil-object' into greasepencil-io 2020-11-26 16:34:44 +01:00
75c925673e Merge branch 'master' into greasepencil-object 2020-11-26 16:33:55 +01:00
510c516bfc Merge branch 'greasepencil-object' into greasepencil-io 2020-11-24 15:29:23 +01:00
af3a3d4adf Merge branch 'master' into greasepencil-object 2020-11-24 15:28:55 +01:00
eca43a5c32 GPencil: More cleanup 2020-11-23 18:17:53 +01:00
4ff3e06e5a GPencil: Fix typo error 2020-11-23 17:24:57 +01:00
31e073b6aa GPencil: Cleanup unused code 2020-11-23 17:17:44 +01:00
1df179ed2c GPencil: Fix crash when object is NULL 2020-11-23 17:07:22 +01:00
428734e839 Merge branch 'greasepencil-object' into greasepencil-io 2020-11-23 15:56:25 +01:00
5e8bf2320a Merge branch 'master' into greasepencil-object 2020-11-23 15:55:48 +01:00
1dfeb5489c GPencil: Move functions to protected 2020-11-22 19:38:47 +01:00
a2585aa5cf GPencil: Move definition to wider scope 2020-11-22 19:35:08 +01:00
15d702b9c5 GPencil: Remove unused function 2020-11-22 19:19:43 +01:00
67685080ee GPencil: Reorganize code to avoid duplications
Now there is an ancestor class with all shared code between export and import
2020-11-22 19:19:09 +01:00
5fa15ff115 GPencil: Replace NULL with C++ nullptr 2020-11-21 16:04:40 +01:00
c30a03850f Merge branch 'greasepencil-object' into greasepencil-io 2020-11-21 15:52:01 +01:00
5d35cf4cdb GPencil: Remove SVG storyboard support
We can include it again in the future, but now it's better to remove it.
2020-11-21 15:51:26 +01:00
b45d3d40bb Merge branch 'master' into greasepencil-object 2020-11-21 15:48:54 +01:00
a686ef38f9 GPencil: Fix error in previous commit 2020-11-20 19:09:21 +01:00
8040dea2b9 GPencil: Add render scale factor 2020-11-20 19:04:05 +01:00
4ab1b3b74b GPencil: Clamp values to avoid errors 2020-11-20 19:03:50 +01:00
6eb8f9c282 GPencil: Export a PDF animation 2020-11-20 17:21:45 +01:00
43d0d074c1 GPencil: Support for PDF export 2020-11-19 23:16:01 +01:00
a884560b2e GPencil: Prepare structure for PDF export
This commit is only to define the different elements.
2020-11-19 20:02:11 +01:00
13b3f52e23 GPencil: Keep Libharu disabled for now 2020-11-19 16:16:45 +01:00
a2efd06f18 GPencil: Avoid calculation of transform matrix for each stroke 2020-11-19 15:24:56 +01:00
c136666b23 GPencil: Add a ToDo 2020-11-19 15:24:56 +01:00
c6b19a2555 GPencil: Include Scale parameter 2020-11-19 15:24:55 +01:00
2e4bad708b GPencil: Add resolution parameter 2020-11-19 15:24:55 +01:00
b0acfabefc GPencil: Apply target object
Also added rotation of the strokes
2020-11-19 15:24:55 +01:00
6b6599624c GPencil: Move points to new origin in center of the strokes 2020-11-19 15:24:55 +01:00
210d909353 GPencil: Basic export working
Still need to recenter the imported data
2020-11-19 15:24:55 +01:00
3791d9ebd9 GPencil: Publish in RNA fill_opacity_fac 2020-11-19 15:24:55 +01:00
6ea082d623 GPencil: More test with SVG 2020-11-19 15:24:55 +01:00
07793477ae GPencil: Free memory 2020-11-19 15:24:55 +01:00
508c9e9723 GPencil: Basic structure of import
Still pending the stroke creation
2020-11-19 15:24:55 +01:00
3c98fbf595 GPencil: Cleanup variable names for non public variables 2020-11-19 15:24:55 +01:00
2b4b1acdab GPencil: Basic structure of Import SVG in place
Actually the code does nothing, just call the function, but the menus and operators are in place.
2020-11-19 15:24:55 +01:00
1c8586c1af GPencil: Move libharu to lib folder
This library will be used to export PDF
2020-11-19 15:24:55 +01:00
39d8532455 GPencil: Remove old code to compile 2020-11-19 15:24:55 +01:00
9d1eed2495 First ideas to improve import/export 2020-11-19 15:24:55 +01:00
e70d880dfd Merge branch 'master' into greasepencil-object 2020-11-19 15:23:42 +01:00
c309abdeb6 GPencil: Fix merge error 2020-11-18 21:49:59 +01:00
3503b71fcc Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/gpencil_geom.c
	source/blender/editors/gpencil/gpencil_utils.c
	source/blender/editors/include/ED_gpencil.h
2020-11-18 21:43:13 +01:00
0070e23aa9 Merge branch 'master' into greasepencil-object 2020-11-18 13:07:53 +01:00
09af58ff60 Merge branch 'master' into greasepencil-object 2020-11-14 15:17:21 +01:00
a6c4b8806f Merge branch 'master' into greasepencil-object 2020-11-14 09:47:11 +01:00
028b3a9ba1 GPencil: Fix compiler errors after merge
Some functions parameter list changed
2020-11-13 22:14:48 +01:00
bbdfa2a434 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/gpencil_geom.c
2020-11-13 21:54:16 +01:00
e52bf731b4 GPencil: Fix compiler error after rename 2020-11-13 19:23:08 +01:00
1f00524977 Merge branch 'master' into greasepencil-object 2020-11-13 18:11:37 +01:00
8a5a6245bf GPencil: Rename private variables 2020-11-12 19:44:49 +01:00
cdd06464ff GPencil: Some cleanup and rename of SVG exported code 2020-11-12 19:42:00 +01:00
d761a37b9d Merge branch 'master' into greasepencil-object 2020-11-09 16:44:02 +01:00
08e08f7116 Merge branch 'master' into greasepencil-object 2020-11-07 11:14:41 +01:00
b98c1ee7e0 Merge branch 'master' into greasepencil-object 2020-11-05 15:48:08 +01:00
7bc829fc42 Merge branch 'master' into greasepencil-object 2020-11-04 16:14:15 +01:00
80feccf326 Merge branch 'master' into greasepencil-object 2020-10-31 09:26:06 +01:00
f92b11b75c Merge branch 'master' into greasepencil-object 2020-10-30 15:48:26 +01:00
d896fd9668 Merge branch 'master' into greasepencil-object 2020-10-29 19:29:41 +01:00
8b346c4b66 Merge branch 'master' into greasepencil-object 2020-10-28 15:45:08 +01:00
aa0188104a Merge branch 'master' into greasepencil-object 2020-10-27 17:40:50 +01:00
6ebd554da9 Merge branch 'master' into greasepencil-object 2020-10-23 19:46:15 +02:00
048d17af9c Merge branch 'master' into greasepencil-object 2020-10-22 20:02:48 +02:00
112c471627 Merge branch 'master' into greasepencil-object 2020-10-21 19:42:03 +02:00
49d017423d Merge branch 'master' into greasepencil-object 2020-10-21 15:33:11 +02:00
6cb358aa2b Merge branch 'master' into greasepencil-object 2020-10-19 15:53:34 +02:00
7c0d2ff90a Merge branch 'master' into greasepencil-object 2020-10-17 12:31:50 +02:00
78ac21c1ae Merge branch 'master' into greasepencil-object 2020-10-15 18:43:59 +02:00
3794c5d905 Merge branch 'master' into greasepencil-object 2020-10-14 15:30:23 +02:00
c93d411ebc Merge branch 'master' into greasepencil-object 2020-10-12 15:41:26 +02:00
56349af122 Merge branch 'master' into greasepencil-object 2020-10-08 10:32:30 +02:00
327007488e Merge branch 'master' into greasepencil-object 2020-10-07 17:10:17 +02:00
2118f3fc12 Merge branch 'master' into greasepencil-object 2020-10-05 15:34:33 +02:00
6d914af830 Merge branch 'master' into greasepencil-object 2020-10-03 11:00:40 +02:00
349cfefaa8 Merge branch 'master' into greasepencil-object 2020-10-01 16:24:58 +02:00
b0545b8272 Merge branch 'master' into greasepencil-object 2020-09-28 17:06:35 +02:00
7fd8d60d0b Merge branch 'master' into greasepencil-object 2020-09-25 15:51:22 +02:00
41c722d4ac Merge branch 'master' into greasepencil-object 2020-09-24 15:56:55 +02:00
ffa528c6c2 Merge branch 'master' into greasepencil-object 2020-09-24 15:27:11 +02:00
2071477c3f Merge branch 'master' into greasepencil-object 2020-09-23 20:09:53 +02:00
354a1427b2 Merge branch 'master' into greasepencil-object 2020-09-22 20:12:28 +02:00
9dc5670d08 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/gpencil.c
	source/blender/editors/gpencil/gpencil_trace_ops.c
	source/blender/editors/gpencil/gpencil_trace_utils.c
2020-09-21 20:09:18 +02:00
978b97352a Merge branch 'master' into greasepencil-object 2020-09-21 17:02:16 +02:00
7e8295c009 Merge branch 'master' into greasepencil-object 2020-09-21 12:09:39 +02:00
424dc8ed2b GPencil: More code cleanup of unused code 2020-09-20 15:33:08 +02:00
0dcd377d15 GPencil: Cleanup unused code 2020-09-20 15:33:08 +02:00
b60f02f75c Merge branch 'master' into greasepencil-object 2020-09-20 15:29:26 +02:00
0850d75b48 Merge branch 'master' into greasepencil-object 2020-09-18 19:12:57 +02:00
cadeb28335 Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/properties_material_gpencil.py
	source/blender/draw/engines/gpencil/gpencil_cache_utils.c
	source/blender/draw/engines/gpencil/gpencil_draw_data.c
	source/blender/draw/engines/gpencil/gpencil_engine.h
	source/blender/draw/engines/gpencil/gpencil_shader_fx.c
	source/blender/draw/engines/gpencil/shaders/gpencil_frag.glsl
	source/blender/makesrna/intern/rna_material.c
2020-09-18 18:31:34 +02:00
9e0712d804 GPencil: Rename Mask material to Holdout in Trace
Mask was the old naming, now must be Holdout.
2020-09-17 19:57:29 +02:00
6c5735923f Merge branch 'master' into greasepencil-object 2020-09-17 19:13:15 +02:00
bb42e537a1 GPencil: Hide trace image menu option if POTRACE is OFF
This hide the menu if the library is not included as option in Make.

Thanks @LazyDodo for his help.
2020-09-17 18:34:04 +02:00
c13e20803e GPencil: Fix typo error in CMake in previous commit 2020-09-17 17:37:49 +02:00
ed7104ac4a GP: Update GP to use potrace from SVN/System
and remove it from /extern
2020-09-17 08:34:14 -06:00
1e7790aa70 Merge branch 'master' into greasepencil-object 2020-09-17 16:09:44 +02:00
735c59b3e4 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
2020-09-16 15:24:16 +02:00
57dba5ee7c GPencil: Define default destructor 2020-09-15 17:05:05 +02:00
5ce2a7f58a GPencil: Fix compiler warnings 2020-09-15 16:43:49 +02:00
1aa7dca0ba Merge branch 'master' into greasepencil-object 2020-09-15 15:26:59 +02:00
ccad97c60b GPencil: Fix warnings in wrong string format 2020-09-15 15:22:29 +02:00
f5ef62dcdd GPencil: Change Holdout tooltip 2020-09-14 17:23:50 +02:00
0245e613f3 GPencil: Change Holdout to Solid Stroke only
Now the Holdout only supports:

* Solid Strokes. (Textured strokes not supported)
* Solid Fill.
* Texture Fills (Alpha section of the texture).
2020-09-14 16:56:57 +02:00
3f60b2233e Merge branch 'master' into greasepencil-object 2020-09-14 15:27:47 +02:00
d47127623e GPencil: Use Texture alpha for Holdout
The holdout only is applied when texture alpha is > 0.
2020-09-13 15:51:49 +02:00
047ff74117 GPencil: Cleanup comments 2020-09-13 15:51:49 +02:00
6cf782ade3 Merge branch 'master' into greasepencil-object 2020-09-12 15:49:23 +02:00
4f6daa5d30 GPencil: Rename Material Masking to Holdout
This name follows better the standard naming.
2020-09-11 15:55:46 +02:00
64c66e63cf Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenkernel/BKE_gpencil.h
2020-09-11 15:42:14 +02:00
f5105fe9f9 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/gpencil_geom.c
2020-09-10 20:14:56 +02:00
bbcaa5eb21 GPencil: Rename Masking to Holdout in UI 2020-09-10 20:01:20 +02:00
70619904a5 GPencil: Fix error after merge 2020-09-10 17:28:13 +02:00
328ef0121c Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/gpencil_geom.c
2020-09-10 16:52:56 +02:00
f54d1cfc86 Merge branch 'master' into greasepencil-object 2020-09-09 15:44:10 +02:00
2d84662a13 GPencil: Fix error for wrong Potrace data
In some situations, Potrace can produce a wrong data and generate a very long stroke. Now the length is checked and removed if the length is too big.
2020-09-09 12:12:38 +02:00
cc19fe7562 Merge branch 'master' into greasepencil-object 2020-09-07 15:46:38 +02:00
08ab3fa7ea Merge branch 'master' into greasepencil-object 2020-09-07 10:13:56 +02:00
fb9078fbed Merge branch 'master' into greasepencil-object 2020-09-05 15:14:17 +02:00
00af270dfb Merge branch 'master' into greasepencil-object 2020-09-03 16:07:36 +02:00
40976d7a6b Merge branch 'master' into greasepencil-object 2020-09-03 08:21:45 +02:00
39acf5fe5a Merge branch 'master' into greasepencil-object 2020-09-01 15:59:17 +02:00
cd6d7a5abc Merge branch 'master' into greasepencil-object 2020-08-31 16:09:00 +02:00
d0be8e4435 Merge branch 'master' into greasepencil-object 2020-08-28 18:31:45 +02:00
e4613cc737 Merge branch 'master' into greasepencil-object 2020-08-28 16:52:45 +02:00
a071229d70 Merge branch 'master' into greasepencil-object 2020-08-26 15:33:32 +02:00
17998b2b86 Merge branch 'master' into greasepencil-object 2020-08-26 10:11:09 +02:00
e52b3e7764 Merge branch 'master' into greasepencil-object 2020-08-25 17:52:20 +02:00
e97121cee5 Merge branch 'master' into greasepencil-object 2020-08-25 10:37:14 +02:00
1c2ddeb634 Merge branch 'master' into greasepencil-object 2020-08-23 16:24:18 +02:00
54cc471e75 Merge branch 'master' into greasepencil-object 2020-08-22 13:10:19 +02:00
73fc37d7f0 Merge branch 'master' into greasepencil-object 2020-08-21 09:49:05 +02:00
f01bad4d3f Merge branch 'master' into greasepencil-object 2020-08-20 22:40:14 +02:00
736edc53b5 GPencil: Cleanup header text of files 2020-08-20 19:56:54 +02:00
a2afe52e5d GPencil: Cleanup Trace images code
Change types and small tweaks
2020-08-20 19:56:16 +02:00
c258b0743c GPencil: Cleanup variable types 2020-08-20 18:15:00 +02:00
c6db271f5e GPencil: Fix missing .hh rename for one file
I missed this in previous commit.
2020-08-20 17:33:30 +02:00
3c2d405cc5 GPencil: Scale strokes to Potrace lib units
After doing a lot of testing, it looks the library is using a factor base on the VGA resolution and aspect ratio.

The formula was obtained experimenting and gets a very good result, but it could be a totally different approach if we find what logic is used by Potrace.
2020-08-20 16:37:07 +02:00
609993f849 GPencil: Rename .h to .hh for C++ header files
This follows the new naming rules
2020-08-20 16:18:22 +02:00
d1a439f71d GPencil: Avoid double geometry update when trace a stroke
As the sample function is already calling the update function, it's not needed to call again.
2020-08-20 16:13:20 +02:00
d8d841dd85 GPencil: Set minimum sampling for traced image
This avoid a huge number of points by stroke.
2020-08-20 09:02:30 +02:00
9cb2d321c1 GPencil: Recalc scale size to fit with Potrace sizes 2020-08-19 20:53:23 +02:00
94b8f50560 Merge branch 'master' into greasepencil-object 2020-08-19 19:53:51 +02:00
f127add04a Merge branch 'master' into greasepencil-object 2020-08-19 07:51:36 +02:00
a4b9973511 GPencil: Replace Trace to use Empty images
Instead to use the Image Editor, now it uses the current selected Empty image
2020-08-18 20:35:32 +02:00
c6ecbe1f9a GPencil: Fix parameter list changes after merge 2020-08-18 16:11:54 +02:00
ba80a6dc08 Merge branch 'master' into greasepencil-object 2020-08-18 16:07:57 +02:00
2399324a15 Merge branch 'master' into greasepencil-object 2020-08-18 11:03:46 +02:00
8cf02c0c2c Merge branch 'master' into greasepencil-object 2020-08-17 11:30:32 +02:00
f9b3fae4ae GPencil: Export SVG fill as polygon
As the Fill hasn't stroke, it's better export as polygon. The stroke is exported in a different SVG command.
2020-08-16 19:55:16 +02:00
c76b8aac17 GPencil: Split SVG exporter version string in two strings
This makes easier to change the version number.
2020-08-15 20:17:40 +02:00
ea01c7fab0 GPencil: Make some functions static
These functions are not using object data
2020-08-15 19:57:22 +02:00
3dc1f1aa23 GPencil: Use uintxx_t instead of generic uint 2020-08-15 19:36:53 +02:00
dfec6eb3e6 GPencil: More cleanup 2020-08-15 17:04:56 +02:00
c8240f05f6 GPencil: Remove unused definitions 2020-08-15 16:34:08 +02:00
495161bc2f GPencil: Reorganizze constructor to set filename 2020-08-15 15:55:37 +02:00
7e26866f78 GPencil: More changes to fix SVG Storyboard
There was a problem with the output file name.
2020-08-15 15:40:15 +02:00
10d0dd4801 GPencil: Cleanup int types to uint 2020-08-15 12:15:46 +02:00
4ab67cde0f GPencil: Cleanup some variable types 2020-08-15 12:15:46 +02:00
5d962f0880 Merge branch 'master' into greasepencil-object 2020-08-15 11:15:11 +02:00
74bd59fe00 GPencil: More SVG code cleanup 2020-08-14 20:27:00 +02:00
cdd980e083 GPencil: Cleanup SVG exporter code 2020-08-14 20:02:08 +02:00
debacc4b0d Merge branch 'master' into greasepencil-object 2020-08-14 17:57:29 +02:00
ff51dc8b49 Merge branch 'master' into greasepencil-object 2020-08-13 20:18:55 +02:00
24d30a3e37 Merge branch 'master' into greasepencil-object 2020-08-13 16:57:25 +02:00
1f8eee240d GPencil: Make Selected as default for SVG export
Instead to use Active, it's better use Selected.
2020-08-13 13:58:25 +02:00
15fab7a345 GPencil: Use Layer thickness esporting SVG polyline 2020-08-13 13:56:34 +02:00
21c45a52a8 GPencil: Change default SVG special groups name
This allows to skip them if the file is imported again.
2020-08-13 12:40:49 +02:00
6ab551ecd9 GPencil: Hide Gray Scale in SVG export
This option is only valid in Storyboards.
2020-08-13 11:26:58 +02:00
74ebba2f97 GPencil: Reorganize SVG export parameters This fix several compiler warnings 2020-08-13 11:11:27 +02:00
b6d19b2279 GPencil: Cleanup compiler warnings 2020-08-13 10:23:06 +02:00
82ff8d8457 Merge branch 'master' into greasepencil-object 2020-08-13 10:01:06 +02:00
586924bc45 GPencil: Replace SVG average factor by stroke thickness factor
Instead to change the point pressure, change the stroke thickness.
2020-08-12 23:42:11 +02:00
9980c85e95 Merge branch 'master' into greasepencil-object 2020-08-12 22:56:24 +02:00
86a2041d47 GPencil: Cleanup code 2020-08-12 22:46:00 +02:00
89f2c6e82d GPencil: Add a small sclae to Polygon lines for SVG
The SVG polyline looks is using the double of the size.
2020-08-12 21:01:48 +02:00
e31f0d1797 Merge branch 'master' into greasepencil-object 2020-08-11 19:15:06 +02:00
0738281050 Merge branch 'master' into greasepencil-object 2020-08-11 15:34:37 +02:00
59cc7581fc Merge branch 'master' into greasepencil-object 2020-08-11 08:20:12 +02:00
b085709f3e Merge branch 'master' into greasepencil-object 2020-08-10 16:35:29 +02:00
85f1a43cf1 Merge branch 'master' into greasepencil-object 2020-08-10 15:35:36 +02:00
e7598096a3 GPencil: Change default Stroke thickness when convert curves
The thickness by default was using the old Draw Engine values and it was too thick in new engine.
2020-08-10 15:32:35 +02:00
afc72974ce GPencil: Remove color conversion when convert curve
In previous versions, grease pencil used sRGB and a color conversion was needed, but now all is Linear and the conversion changes the color wrongly.
2020-08-10 13:51:02 +02:00
7d75070abd GPencil: Missing rename in previous commit 2020-08-09 19:23:37 +02:00
b65e9771a2 GPencil: Rename SVG export files 2020-08-09 19:17:24 +02:00
3620c9ebf8 GPencil: Support unicode paths in Windows for SVG export
Also some small cleaunp.
2020-08-09 17:45:58 +02:00
8421dffa3d Merge branch 'master' into greasepencil-object 2020-08-08 12:50:05 +02:00
cce23c8be8 Merge branch 'master' into greasepencil-object 2020-08-05 18:30:12 +02:00
e15120f5a8 Merge branch 'master' into greasepencil-object 2020-08-05 11:30:19 +02:00
cd6edde235 GPencil: Split SVG modes in two operators 2020-08-05 11:24:09 +02:00
01d49812b0 GPencil: Check camera view before export SVG 2020-08-04 17:12:20 +02:00
f25060c4c3 Merge branch 'master' into greasepencil-object 2020-08-04 16:43:59 +02:00
4c83d6b51a GPencil: Include scene name at the bottom of SVG export 2020-08-04 16:39:30 +02:00
0d0ec8503b GPencil: Fix error with boundbox exporting to SVG from view 2020-08-04 16:00:00 +02:00
7d08c58f72 GPencil: Add markers support to SVG export
Instead to export all frames, only export frames with markers.
2020-08-04 13:52:48 +02:00
023cd624a1 GPencil: Add text in the output SVG for each frame 2020-08-04 12:59:32 +02:00
e6107d2b7b GPencil: New SVG export parameters
New parameters for page size and layout.
2020-08-04 11:30:16 +02:00
d808a42fb6 GPencil: Reorganize SVG exporter UI
This is in preparation for more options.
2020-08-04 09:15:25 +02:00
daeab89f75 GPencil: Reload object list for each frame 2020-08-04 08:58:47 +02:00
91a8426bc8 GPencil: Add different list of select type 2020-08-03 23:48:38 +02:00
4325cc63cc GPencil: Fix problems with duplicated SVG frames 2020-08-03 20:52:51 +02:00
8f601a3513 GPencil: More work to export animations to SVG 2020-08-03 18:06:11 +02:00
7b8d7e4486 GPencil: Comment debug SVG lines 2020-08-03 18:06:11 +02:00
0e96dd59d4 GPencil: Comment debug SVG lines 2020-08-03 12:41:25 +02:00
dfbe52e353 Merge branch 'master' into greasepencil-object 2020-08-03 12:35:34 +02:00
ead15ad3df GPencil: Fix error in SVG clipping camera 2020-08-03 12:34:33 +02:00
47470b67af GPencil: Export SVG using size of the boundbox if not using camera 2020-08-03 12:29:59 +02:00
41d1c9afdb GPencil : Fix error exporting animation to SVG 2020-08-02 13:17:55 +02:00
9a47f43ddc GPencil: Reorganize code 2020-08-02 12:34:03 +02:00
ceded9f4c5 GPencil: Calculate Selected strokes bound box
This is required for SVG export
2020-08-02 12:25:47 +02:00
451a55a159 GPencil: Add SVG gray scale option
Now it's possible export in gray scale.
2020-08-01 23:01:57 +02:00
a119282161 GPencil: Fix SVG export zdepth issues using other views.
It was working only in camera view.
2020-08-01 21:06:18 +02:00
281fc4b93b GPencil: Cleanup commented lines 2020-08-01 20:56:26 +02:00
b00bc42dd0 GPencil: Add sampling parameter to SVG export 2020-08-01 20:53:43 +02:00
4e3a364241 GPencil: Add clipping camera exporting to SVG 2020-08-01 19:36:55 +02:00
6d6f3363f8 GPencil: Cleanup code 2020-08-01 19:20:55 +02:00
76291e4c92 GPencil: Use render size when export SVG in camera view 2020-08-01 19:11:13 +02:00
d6c3158f4d GPencil: Fix error in previous refactor 2020-08-01 13:36:22 +02:00
f92d5c87a0 Merge branch 'master' into greasepencil-object 2020-08-01 12:13:19 +02:00
9a476d54fe Merge branch 'master' into greasepencil-object 2020-08-01 11:21:17 +02:00
1b75ceff7a GPencil: Cleanup code and rename variables 2020-08-01 11:19:40 +02:00
09d163ac04 GPencil: Sort objects in zdepth before exporting to SVG 2020-08-01 11:15:49 +02:00
215b894b74 GPencil: Cleanup SVG code 2020-07-31 23:48:39 +02:00
a5aaadb791 GPencil: Do not export stroke for SVG paths 2020-07-31 23:30:16 +02:00
621a63c587 GPencil: Display list of files for SVG export 2020-07-31 19:47:09 +02:00
d9fddf3279 GPencil: Avoid SVG attributes when not needed 2020-07-31 19:39:30 +02:00
40fb85a4a6 GPencil: Add a SVG group level for object 2020-07-31 17:58:24 +02:00
a4879a63a1 GPencil: Change default File dialog to Files 2020-07-31 17:40:51 +02:00
ede2bb2d58 GPencil: Add wait cursor while exporting to SVG 2020-07-31 17:36:21 +02:00
91b4ff561f GPencil: Check if line is thickness equal for all points for SVG export 2020-07-31 17:32:36 +02:00
47ba69079b GPencil: Handle Stroke opacity in SVG export
Also removed stroke for filled areas is the stroke is disabled
2020-07-31 17:23:25 +02:00
c6c989c169 GPencil: Add SVG vertex color export limitted support
It's impossible export vertex color, so an average color is used.
2020-07-31 16:51:09 +02:00
2c854c5e6d GPencil: Remove Styles from SVG
There are so many exceptions that is better avoid the use of styles.
2020-07-31 16:11:42 +02:00
d806c58d1e Merge branch 'master' into greasepencil-object 2020-07-31 12:44:18 +02:00
d14a573c9b Merge branch 'master' into greasepencil-object 2020-07-31 12:05:52 +02:00
0f60cefa29 GPencil: Remove this pointer from SVG exporter 2020-07-31 11:59:57 +02:00
0a06f23e8e GPencil: Use Layer tint/opacity and thickness in SVG export 2020-07-31 11:14:22 +02:00
be2f12ef35 GPencil: Apply Layer thickness to SVG strokes 2020-07-31 10:29:36 +02:00
3921397201 GPencil: Export all selected objects to SVG 2020-07-30 20:41:13 +02:00
2c7e7322b4 GPencil: Fix error with SVG export path has points 2020-07-30 16:39:15 +02:00
2d58b0950b GPencil: Fix SVG export problem for active frame
If the current frame was higher, the export was not done.
2020-07-29 21:00:36 +02:00
3727bbb127 GPencil: Check return value for SVG export 2020-07-29 20:29:23 +02:00
f7f178a245 Merge branch 'master' into greasepencil-object 2020-07-29 10:38:59 +02:00
5c9155d615 GPencil: Add SVG exporter version string 2020-07-29 10:33:45 +02:00
4814e26b17 GPencil: Change to SVG 1.1 version 2020-07-29 10:23:29 +02:00
7d166ddf2a GPencil: reorganize code to make it more C++ish 2020-07-29 10:20:09 +02:00
61b15af3e9 GPencil: More cleanup in SVG exporter 2020-07-28 23:38:36 +02:00
c23376057b GPencil: Add single point SVG opacity 2020-07-28 23:32:51 +02:00
23a766eeca GPencil: Add fill opacity 2020-07-28 23:29:39 +02:00
30d817fdd8 GPencil: Fix comment typo error 2020-07-28 23:14:30 +02:00
ebf5657733 GPencil: Reformat code and cleanup parameter list
Also added round caps.
2020-07-28 23:14:12 +02:00
1a9b0127d9 Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object 2020-07-28 21:06:42 +02:00
83854be460 GPencil: Add 2d stroke perimeter function 2020-07-28 21:06:34 +02:00
539aef6e35 GPencil: Fix pugixml library linking on linux 2020-07-28 21:05:03 +02:00
a308d8417f GPencil: Remove bmain context use
This is part of the cleanup to reduce the use of bContext to minimum
2020-07-28 18:51:59 +02:00
f8f45b1b9e GPencil: Remove Context use to minimum 2020-07-28 18:36:45 +02:00
61c03eb734 Merge branch 'master' into greasepencil-object 2020-07-28 09:15:05 +02:00
3c316c91ad GPencil: Add generic Y axis invert to main function
This removes duplicate code
2020-07-27 23:24:24 +02:00
86e39af152 GPencil: Remove duplicated code for SVG point radius
Now it's using the same function in all places.
2020-07-27 23:17:20 +02:00
d0f688a33d GPencil: Fix error when use perimter function
The BKE function was changing the original stroke. Now a temp copy is done.
2020-07-27 23:10:29 +02:00
5f87e343ff GPencil: Rename export functions 2020-07-27 23:01:07 +02:00
85898fb122 GPencil: Add option to export SVG in constant thickness lines 2020-07-27 22:57:29 +02:00
e6fab8dc39 GPencil: New function to determine if the stroke has same thickness in all points 2020-07-27 18:59:57 +02:00
219bea8572 GPencil: Rename export_stroke function 2020-07-27 18:59:30 +02:00
8643663965 Merge branch 'master' into greasepencil-object 2020-07-27 18:36:03 +02:00
94e1b14cea GPencil: New option to disable fill strokes in SVG export 2020-07-27 18:35:38 +02:00
90212c3cb5 GPencil: Fix style error in Illustrator
The style name cannot contain underscore character
2020-07-27 13:22:34 +02:00
b9e488b08a GPencil: Remove duplicated temp stroke
This was to bypass a bug, but now it's not required.
2020-07-27 13:06:32 +02:00
7a85be00b5 GPencil: Calculate real radius size for SVG point 2020-07-27 13:01:10 +02:00
e94a4b140a GPencil: Cleanup code 2020-07-27 12:24:25 +02:00
d9ab196134 GPencil: Preparation to export point to SVG as circles
Still wip.
2020-07-27 10:58:02 +02:00
b2356b4c74 Merge branch 'master' into greasepencil-object 2020-07-27 10:50:08 +02:00
2c1b067972 GPencil: Include option to export only active frame in SVG 2020-07-26 22:30:46 +02:00
20e882b2d0 GPencil: Skip empty frames in SVG export 2020-07-26 20:18:36 +02:00
ba00eff188 GPencil: Export a range of frames to SVG 2020-07-26 18:22:00 +02:00
9b08978746 GPencil: Use evaluated strokes for SVG export
Now the SVG includes the strokes with modifiers.
2020-07-26 17:06:14 +02:00
4fdab28f77 GPencil: Fix errors with strokes with Stroke and Fill 2020-07-26 16:54:31 +02:00
96a256f757 GPencil: Change to style instead of material name
Also added support for default material
2020-07-26 13:08:48 +02:00
d3407405cb GPencil: Add a prefix to styles
The style name cannot start with numbers
2020-07-25 23:46:04 +02:00
bb9356aa62 GPencil: More adjust to SVG export
Working in Fill attributes
2020-07-25 23:32:57 +02:00
2d8c9efbad GPencil: Some tweaks to create filled areas 2020-07-25 21:17:00 +02:00
249cafebf8 GPencil: Integrate perimter functions
This is a modified version of the functions included in D6637

https://developer.blender.org/D6637
2020-07-25 20:38:33 +02:00
48d96ca77a Merge branch 'temp-export-xml' into greasepencil-object 2020-07-25 16:32:03 +02:00
12990d264a Merge branch 'master' into greasepencil-object 2020-07-25 16:24:42 +02:00
533ccfed03 GPencil: Include Styles 2020-07-25 16:17:56 +02:00
151fb02f18 GPencil: Fix size and position issue
Also, structure code.
2020-07-25 12:15:41 +02:00
10e9be3cec GPencil: Basic path exported
Still pending perimter, materials and center in the document.
2020-07-24 22:41:36 +02:00
7b65016444 GPencil: Basic structure of layers
The problem was the Region was NULL, but now using a function the region is right.
2020-07-24 21:07:17 +02:00
d7b63f3b16 Merge branch 'master' into temp-export-xml 2020-07-24 16:29:41 +02:00
77e7a7d19a Merge branch 'master' into greasepencil-object 2020-07-24 16:25:14 +02:00
b385f6ea72 More test 2020-07-24 16:03:21 +02:00
4816fa64c5 GPencil: Basic structure of XML with GP Object 2020-07-24 11:41:58 +02:00
3361620d68 GPencil: reorganize code
Prepare to have more exporter types
2020-07-23 23:06:35 +02:00
0bb0feeacd GPencil: Basic creation of XML
All parts in place, ready to start to create the export
2020-07-23 20:19:19 +02:00
06337279c7 GPencil: More basis structure changes 2020-07-23 17:27:54 +02:00
65596c165f GPencil: Prepare basic structure for Export Operator
Still is not calling anything
2020-07-23 17:17:52 +02:00
4e897f23c7 GPencil: Prepare IO operator project
This is just an empty structure
2020-07-23 17:06:30 +02:00
04edb6951b GPencil: Rename IO project
Old name was redundant.
2020-07-23 16:46:12 +02:00
6071e182d8 GPencil: Create basic structure of new project for IO
This project will be used to export data.
2020-07-23 16:38:07 +02:00
5b97867905 GPencil: Fix unreported missing frames in interpolation
When interpolate, the temp frames are tagged, and later removed. If for any reason any stroke was tagged in other area of Blender (this tag is used for temp tagging), the stroke could be removed by error when run interpolation.

In a previous fix, the tag was cleared before, but only for the frame range of the interpolation. Now, the clear is done for all frames.

Also, instead to clear for each stroke sampling, now it's done only once at invoke time.
2020-07-23 16:03:38 +02:00
3c7e253a48 Merge branch 'master' into greasepencil-object 2020-07-23 13:16:38 +02:00
e9d73d82eb GPencil: Missing rename in previous commit 2020-07-22 18:29:29 +02:00
579c6200de GPencil: Cleanup - rename trace functions 2020-07-22 18:15:10 +02:00
6d04affdd7 GPencil: More changes to trace image
Cleanup code and tweaks
2020-07-22 15:34:34 +02:00
4a02da4f75 Merge branch 'master' into greasepencil-object 2020-07-22 11:19:40 +02:00
f43067b109 GPencil: Cleanup comments 2020-07-21 20:19:36 +02:00
be2c0ba543 Merge branch 'master' into greasepencil-object 2020-07-21 19:15:43 +02:00
62d6adc11b GPencil: Implement holes for Trace Images
As the new masking modes are available for materials, now it's possible open holes for negative strokes.
2020-07-21 19:14:13 +02:00
9c2476e1b3 Merge branch 'master' into greasepencil-object 2020-07-21 15:54:36 +02:00
055473d916 GPencil: Fix wrong value in previous commit 2020-07-21 13:32:53 +02:00
8845a51e79 GPencil: Masking materials using alpha channel 2020-07-21 13:23:49 +02:00
bc76dff4f5 Merge branch 'master' into greasepencil-object 2020-07-20 20:21:28 +02:00
5e1faae2e5 GPencil: Change shader logic to use holes
The process must be done if the holes are used.
2020-07-20 20:20:45 +02:00
ccc01cad5b GPencil: Fix draker areas on transparent holes
Thanks to Clément for his help fixing it.
2020-07-20 18:50:59 +02:00
9f2ed6ca88 Merge branch 'master' into greasepencil-object 2020-07-20 11:11:56 +02:00
160c5b9f94 Merge branch 'master' into greasepencil-object 2020-07-18 10:34:55 +02:00
483c144677 Merge branch 'master' into greasepencil-object 2020-07-17 16:46:25 +02:00
7112348823 Merge branch 'master' into greasepencil-object 2020-07-16 17:45:32 +02:00
af78a574f4 Merge branch 'master' into greasepencil-object 2020-07-16 08:16:54 +02:00
3c2e9322cb Merge branch 'master' into greasepencil-object 2020-07-15 12:08:32 +02:00
eb5364a516 Merge branch 'master' into greasepencil-object 2020-07-14 10:43:59 +02:00
3432535754 Merge branch 'master' into greasepencil-object 2020-07-13 10:38:57 +02:00
a53e5654e1 Merge branch 'master' into greasepencil-object 2020-07-11 20:30:32 +02:00
2fefbdf928 Merge branch 'master' into greasepencil-object 2020-07-10 17:09:59 +02:00
590261a617 GPencil: Cleanup masking flags management in shaders 2020-07-09 17:44:10 +02:00
1e8fd2b0e1 Merge branch 'temp-gpencil-mat-masking' into greasepencil-object 2020-07-09 17:00:53 +02:00
37c1c0ad0d Merge branch 'master' into temp-gpencil-mat-masking 2020-07-09 15:48:44 +02:00
0243b5e485 Merge branch 'master' into greasepencil-object 2020-07-09 15:48:09 +02:00
b53dd2b8cc Merge branch 'master' into greasepencil-object 2020-07-08 11:11:20 +02:00
b0b9dc581a Merge branch 'master' into temp-gpencil-mat-masking 2020-07-08 11:10:29 +02:00
41099f9510 Merge branch 'master' into temp-gpencil-mat-masking 2020-07-07 16:22:11 +02:00
486d3783d0 Merge branch 'master' into greasepencil-object 2020-07-07 16:21:42 +02:00
0aa177257f Merge branch 'master' into temp-gpencil-mat-masking 2020-07-07 10:30:28 +02:00
3e422bf531 Merge branch 'master' into temp-gpencil-mat-masking 2020-07-06 20:28:02 +02:00
f7258ad010 Merge branch 'master' into greasepencil-object 2020-07-06 20:27:45 +02:00
7e1ed248f7 Merge branch 'master' into greasepencil-object 2020-07-05 17:31:56 +02:00
461fe8accb Merge branch 'master' into temp-gpencil-mat-masking 2020-07-05 17:30:21 +02:00
653ce17ef7 Merge branch 'master' into greasepencil-object 2020-07-04 11:04:54 +02:00
012e08dbb2 Merge branch 'master' into greasepencil-object 2020-07-04 09:58:20 +02:00
628c331ae6 Merge branch 'master' into greasepencil-object 2020-07-03 20:08:42 +02:00
51a7d11f68 GPencil: Remove bake frame initialization in Trace script
This is to avoid the same error of T78555
2020-07-03 15:59:22 +02:00
05f6702d2e Merge branch 'master' into greasepencil-object 2020-07-03 15:44:42 +02:00
2c50b8b76a Merge branch 'master' into greasepencil-object 2020-07-03 13:52:22 +02:00
8da31df555 Merge branch 'master' into greasepencil-object 2020-07-03 11:22:58 +02:00
f4d7304f7e Merge branch 'master' into greasepencil-object 2020-07-02 20:05:17 +02:00
c40537adff Merge branch 'master' into temp-gpencil-mat-masking 2020-07-02 09:32:39 +02:00
4c4798abe4 Merge branch 'master' into greasepencil-object 2020-07-02 09:32:08 +02:00
d6bd8db1d4 Merge branch 'master' into temp-gpencil-mat-masking 2020-07-01 18:55:21 +02:00
b96db3a0aa Merge branch 'master' into temp-gpencil-mat-masking 2020-07-01 18:01:14 +02:00
bd5d93b29f Add flags for Stroke and for fill 2020-07-01 17:45:16 +02:00
af74e6c07a Basic holes running in Viewport and Render
Pending of render layer by layer
2020-07-01 17:19:16 +02:00
d9e9ac8f29 Merge branch 'master' into greasepencil-object 2020-07-01 09:17:24 +02:00
86e5f50877 Merge branch 'master' into temp-gpencil-mat-masking 2020-07-01 09:17:00 +02:00
de8db62eaf Merge branch 'master' into greasepencil-object 2020-06-30 15:48:10 +02:00
c09e49e39e Merge branch 'master' into temp-gpencil-mat-masking 2020-06-30 15:46:41 +02:00
f3c09f2e5a Merge branch 'master' into temp-gpencil-mat-masking 2020-06-29 22:45:16 +02:00
bfe4ce6799 Merge branch 'master' into greasepencil-object 2020-06-29 20:19:38 +02:00
de5642eecd GPencil: Cleanup - Rename prefix gp_ to gpencil_ 2020-06-29 15:59:07 +02:00
829b305a68 Merge branch 'master' into greasepencil-object 2020-06-29 15:52:35 +02:00
9afa6990bf Merge branch 'master' into greasepencil-object 2020-06-28 16:56:09 +02:00
14192f2459 Merge branch 'master' into greasepencil-object 2020-06-28 11:29:08 +02:00
51776086c1 Merge branch 'master' into greasepencil-object 2020-06-26 12:56:46 +02:00
f57de0aebd Merge branch 'master' into greasepencil-object 2020-06-25 15:40:15 +02:00
e32945bfd3 Merge branch 'master' into greasepencil-object 2020-06-24 16:01:59 +02:00
1957304f9b GPencil: Spread the point os sampled points 2020-06-24 16:01:10 +02:00
64a655ec4c GPencil: Increase default buffer size
Using spread the number of points is huge and for each expand of points there is a small flash on the screen, so keep a big buffer reduce the effect.
2020-06-24 16:01:05 +02:00
a3c4e90969 GPencil: First steps to implement spread for a segment
Still not working. Keep this commit to save the current status.
2020-06-24 16:01:01 +02:00
0974ab0ab7 GPencil: Reformat spread code and prepare for sampled points 2020-06-24 16:00:57 +02:00
1fc71bf2ea GPencil: Basic spread point functionality 2020-06-24 16:00:52 +02:00
9f16512509 Merge branch 'master' into greasepencil-object 2020-06-23 19:26:01 +02:00
b26c1ccb36 Merge branch 'master' into greasepencil-object 2020-06-23 16:28:50 +02:00
3ce4bf8a8f Merge branch 'master' into greasepencil-object 2020-06-22 19:46:40 +02:00
46cbaeb174 Merge branch 'master' into greasepencil-object 2020-06-22 10:52:46 +02:00
23a8f5ddf8 Merge branch 'master' into greasepencil-object 2020-06-22 10:44:39 +02:00
030cbc80d9 GPencil: Remove Fill selection with Tweak tool and fix bug
* Fixed selection of point in multiframe mode. The point was not selected.

* Removed the fill area selection because makes the tool imprecise, and for this tool need to be precise or the selection is impossible. Now only select if it's over the point, not over the filled area.
2020-06-22 10:40:50 +02:00
46a228c93e GPencil: Fix masking material on top error 2020-06-21 19:18:58 +02:00
fc92a3f60f Merge branch 'master' into temp-gpencil-mat-masking 2020-06-21 18:55:52 +02:00
127e5edc04 Merge branch 'master' into greasepencil-object 2020-06-21 15:55:52 +02:00
c9c4195f11 Merge branch 'master' into greasepencil-object 2020-06-20 11:58:53 +02:00
6e43f1e01c Merge branch 'master' into greasepencil-object 2020-06-19 23:03:57 +02:00
0c88de8463 Merge branch 'master' into greasepencil-object 2020-06-19 19:42:46 +02:00
9566f2399b Merge branch 'master' into greasepencil-object 2020-06-19 10:10:33 +02:00
0f5ee72c0a Merge branch 'master' into greasepencil-object 2020-06-18 20:34:34 +02:00
e6de4648b2 Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_operators/__init__.py
	source/blender/blenkernel/intern/gpencil_geom.c
2020-06-16 17:39:03 +02:00
190493b981 Merge branch 'master' into greasepencil-object 2020-06-15 11:49:30 +02:00
bcd8900343 Merge branch 'master' into greasepencil-object 2020-06-15 10:30:51 +02:00
c657c2b64c Merge branch 'master' into greasepencil-object 2020-06-13 15:38:26 +02:00
f7b9212bc5 Merge branch 'master' into greasepencil-object 2020-06-12 15:58:40 +02:00
b757ebf01c Merge branch 'master' into greasepencil-object 2020-06-12 10:52:55 +02:00
f0d75adc3b Merge branch 'master' into greasepencil-object 2020-06-11 10:43:51 +02:00
485fc1629c Merge branch 'master' into greasepencil-object 2020-06-10 20:01:21 +02:00
cb8292c969 Merge branch 'master' into greasepencil-object 2020-06-10 15:43:24 +02:00
028243f739 Merge branch 'master' into greasepencil-object 2020-06-10 11:45:35 +02:00
74e48ae1fd Merge branch 'master' into greasepencil-object 2020-06-10 11:28:01 +02:00
240766673d Merge branch 'master' into greasepencil-object 2020-06-09 19:49:14 +02:00
890852bd07 Merge branch 'master' into greasepencil-object 2020-06-09 15:49:00 +02:00
c5475cf33e Merge branch 'master' into greasepencil-object 2020-06-09 10:16:12 +02:00
4e1399a182 First test of material masking
This is to open holes in fill areas
2020-06-08 19:18:21 +02:00
a7d50ab45f Merge branch 'master' into greasepencil-object 2020-06-08 09:08:39 +02:00
7cbe778708 Merge branch 'master' into greasepencil-object 2020-06-07 13:26:07 +02:00
a2b7beb4a4 Merge branch 'master' into greasepencil-object 2020-06-06 10:23:44 +02:00
6ca295a630 Merge branch 'master' into greasepencil-object 2020-06-06 08:22:57 +02:00
942da35709 Merge branch 'master' into greasepencil-object 2020-06-05 15:11:57 +02:00
4d0cbcaa64 Merge branch 'master' into greasepencil-object 2020-06-04 18:48:20 +02:00
87757e3ba4 Merge branch 'master' into greasepencil-object 2020-06-04 09:42:00 +02:00
443d8d43ba Merge branch 'master' into greasepencil-object 2020-06-03 20:19:29 +02:00
72bfeadbf5 Merge branch 'master' into greasepencil-object 2020-06-03 15:59:02 +02:00
9dd798c549 Merge branch 'master' into greasepencil-object 2020-06-02 18:43:01 +02:00
9543d7c406 Merge branch 'master' into greasepencil-object 2020-05-31 20:04:34 +02:00
77b2141cb4 Merge branch 'master' into greasepencil-object 2020-05-30 17:34:04 +02:00
464c059291 Merge branch 'master' into greasepencil-object 2020-05-29 09:58:59 +02:00
44a9443644 Merge branch 'master' into greasepencil-object 2020-05-28 16:18:40 +02:00
2273761d62 Merge branch 'master' into greasepencil-object 2020-05-27 20:13:42 +02:00
a50976c3c7 GPencil: Show only first frame if current frame is >=
Previously, the first frame was displayed since frame 0, but now, the first frame is only displayed when the current frame is equals or greater than the keyframe number.

Differential Revision: https://developer.blender.org/D7851
2020-05-27 19:54:35 +02:00
5e1f5f8364 GPencil: Fix error after merge 2020-05-27 15:57:48 +02:00
f1d0a6dd2d Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_edit.c
2020-05-27 15:45:10 +02:00
4432b2205a Merge branch 'master' into greasepencil-object 2020-05-26 16:08:39 +02:00
88006374ab GPencil: Change operator Tooltip 2020-05-26 13:51:00 +02:00
30ef027f60 Merge branch 'master' into greasepencil-object 2020-05-26 11:31:29 +02:00
10109affb6 Merge branch 'master' into greasepencil-object 2020-05-24 10:22:59 +02:00
bcef248a8c Merge branch 'master' into greasepencil-object 2020-05-23 15:26:52 +02:00
6c7a3e89cf Merge branch 'master' into greasepencil-object 2020-05-22 18:21:10 +02:00
b05147c35c Merge branch 'master' into greasepencil-object 2020-05-22 15:25:03 +02:00
7af146c4a7 Merge branch 'master' into greasepencil-object 2020-05-21 10:04:39 +02:00
b581973b6b Merge branch 'master' into greasepencil-object 2020-05-20 16:18:41 +02:00
594cf7d692 Merge branch 'master' into greasepencil-object 2020-05-19 12:21:09 +02:00
1d3ca210a7 Merge branch 'master' into greasepencil-object 2020-05-18 17:05:13 +02:00
64f909d360 Merge branch 'master' into greasepencil-object 2020-05-15 16:52:26 +02:00
cbbda85dbe Merge branch 'master' into greasepencil-object 2020-05-15 13:06:35 +02:00
5c262734ad Merge branch 'master' into greasepencil-object 2020-05-14 19:54:51 +02:00
9dd0811999 Merge branch 'master' into greasepencil-object 2020-05-14 16:33:24 +02:00
3a4b985bdd Merge branch 'master' into greasepencil-object 2020-05-13 22:56:48 +02:00
e876c14398 Merge branch 'master' into greasepencil-object 2020-05-13 13:04:46 +02:00
46c5980f18 Merge branch 'master' into greasepencil-object 2020-05-12 17:59:52 +02:00
ff68a26c37 Merge branch 'master' into greasepencil-object 2020-05-12 10:39:28 +02:00
e1598bb55f Merge branch 'master' into greasepencil-object 2020-05-11 16:34:59 +02:00
bce29c42f9 Merge branch 'master' into greasepencil-object 2020-05-11 13:56:25 +02:00
ee9be81a48 Merge branch 'master' into greasepencil-object 2020-05-11 13:01:48 +02:00
d4877b33d3 GPencil: Rename Percentage Mode 2020-05-10 18:41:22 +02:00
dbe913cd7c GPencil: Cleanup code 2020-05-09 16:46:52 +02:00
4ad50de253 GPencil: New Percentage parameter in Build modifier
Add a factor to determine the percentage affected.

Still wip.
2020-05-09 16:12:06 +02:00
0283a51182 Merge branch 'master' into greasepencil-object 2020-05-09 13:44:12 +02:00
32632e9636 Merge branch 'master' into greasepencil-object 2020-05-08 11:16:55 +02:00
2c789417e4 Merge branch 'master' into greasepencil-object 2020-05-08 10:36:37 +02:00
712442eec0 Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
	release/scripts/startup/bl_ui/space_view3d_toolbar.py
	source/blender/makesrna/intern/rna_brush.c
2020-05-07 15:19:08 +02:00
ceab942e50 Merge branch 'master' into greasepencil-object 2020-05-07 12:17:41 +02:00
07efb29e80 Merge branch 'master' into greasepencil-object 2020-05-07 10:12:33 +02:00
f8cbdfc1e7 Merge branch 'master' into greasepencil-object 2020-05-06 18:52:27 +02:00
61f04263a2 merge master and fix issues 2020-05-06 18:49:19 +02:00
381d8c41a4 Merge branch 'master' into greasepencil-object 2020-05-06 16:28:09 +02:00
64e5ca5d99 Merge branch 'master' into greasepencil-object 2020-05-06 15:59:09 +02:00
9838ca0019 Merge branch 'master' into greasepencil-object 2020-05-06 12:23:02 +02:00
3e2730e900 Merge branch 'master' into greasepencil-object 2020-05-06 10:25:50 +02:00
0a344b387a Cleanup: rename mcords to mcoords 2020-05-04 17:27:08 +02:00
d3bd805c96 Merge branch 'master' into greasepencil-object 2020-05-04 17:24:13 +02:00
d197243393 Merge branch 'master' into greasepencil-object 2020-05-03 20:35:54 +02:00
c21fc855a8 Merge branch 'master' into greasepencil-object 2020-05-03 13:35:26 +02:00
7960f27df1 GPencil: More test of the Chisel brush 2020-05-02 16:21:21 +02:00
320e57d644 GPencil: More changes to improve Chisel brush 2020-05-02 13:05:25 +02:00
41bd45d080 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_paint.c
2020-05-02 10:50:04 +02:00
8f117b39fc Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_paint.c
2020-05-01 19:18:50 +02:00
91c486facb Merge branch 'master' into greasepencil-object 2020-05-01 09:41:13 +02:00
cab9d96455 GPencil: Fix more compiler warnings 2020-04-30 18:24:17 +02:00
981cf57eb8 GPencil: Fix compiler warning 2020-04-30 18:18:11 +02:00
94fb5199f6 Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/presets/keyconfig/keymap_data/blender_default.py
	release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
2020-04-30 16:43:39 +02:00
81b7e33b28 Merge branch 'master' into greasepencil-object 2020-04-30 10:48:38 +02:00
3187f0b853 Merge branch 'master' into greasepencil-object 2020-04-29 10:15:20 +02:00
c3bbe499b7 Merge branch 'master' into greasepencil-object 2020-04-28 15:46:17 +02:00
382042a603 Merge branch 'master' into greasepencil-object 2020-04-28 10:21:59 +02:00
7167328ebc Merge branch 'master' into greasepencil-object 2020-04-27 10:50:19 +02:00
df4027e351 Merge branch 'master' into greasepencil-object 2020-04-25 19:43:20 +02:00
fdaf7c618a Merge branch 'master' into greasepencil-object 2020-04-25 10:42:09 +02:00
59fd8e0a98 Merge branch 'master' into greasepencil-object 2020-04-24 15:27:50 +02:00
499da55d64 GPencil: Move curve Sensibity below prop 2020-04-23 14:21:43 +02:00
c7fb2884a6 GPencil: Remove Curves from popover and move strength curve 2020-04-23 13:49:01 +02:00
24b25dccad Merge branch 'master' into greasepencil-object 2020-04-23 11:56:09 +02:00
f8cd309708 GPencil: Cleanup code 2020-04-23 11:55:11 +02:00
bcd6494a27 GPencil: Try to attenuate pressure
Test to verify random curve values
2020-04-23 00:18:22 +02:00
4928fc93b6 GPencil: Fix random pressure when pressure switch is disabled
The random curve must use the pressure all the times.
2020-04-22 19:48:36 +02:00
8b4a118209 GPencil: Set Cuve panels closed by default 2020-04-22 18:29:48 +02:00
8e06289d98 Cleanup: Fix pep8 line spacing 2020-04-22 18:18:44 +02:00
4a1d07cb07 GPencil: Cleanup - make function static 2020-04-22 18:15:32 +02:00
66a958ba42 GPencil: Fix randomize curve with very low pressure 2020-04-22 18:11:33 +02:00
27b54669c4 GPencil: Remove Curve Popover and group in Advanced
This followws the curve near of the prop, but as these props are in topbar, we put in the main popover.
2020-04-22 17:50:57 +02:00
3a10b9d4bc GPencil: Use Enabled instead of Active to disable panel 2020-04-22 16:50:02 +02:00
96bcf0e9df GPencil: Fix wrong properties split 2020-04-22 16:43:41 +02:00
ddadfff17d GPencil: Move curves below each property 2020-04-22 16:31:25 +02:00
55f78da8ab GPencil: Fix error using Random curve
The curve must be used as factor.
2020-04-22 15:58:55 +02:00
8688c00023 GPencil: Minor style cleanup 2020-04-22 12:00:21 +02:00
7fb06264cc GPencil: Use expanded enum for Random Curve tab selector 2020-04-22 11:54:00 +02:00
1a1e8f363d GPencil: Make Random Curve panels more compact
Instead to use a panel by curve, use tabs.
2020-04-22 11:46:45 +02:00
92faa22700 GPencil: New Brush Random curves
This commit makes possible to apply a curve for each of the random values of the brush to have more control.

The value of the curve is determined by the pressure of the pen.
2020-04-22 11:05:00 +02:00
9290d41c58 Merge branch 'master' into greasepencil-object 2020-04-21 19:17:56 +02:00
f99204c218 GPencil: Add new Randomness to primitives 2020-04-21 18:07:11 +02:00
8425ed4288 GPencil: Add Pressure, Strength and UV randomness at stroke level
Instead to random at point level, a general random by stroke is generated.
2020-04-21 16:27:56 +02:00
24e90e59f7 Merge branch 'master' into greasepencil-object 2020-04-21 13:05:09 +02:00
34ce7a5f3a GPencil: Fix Hue random to use full range
The value was clamped and the colors in the extreme was not working as expected.
2020-04-21 12:23:54 +02:00
c7aee9ea84 GPencil: Improve randomness with time 2020-04-20 23:23:26 +02:00
2f5d2f5d6c GPencil: Rename functions 2020-04-20 22:58:20 +02:00
69b8215797 GPencil: Add HSV randomness at Stroke level 2020-04-20 22:24:25 +02:00
56f85d156d GPencil: Change attenuation value for random HSV 2020-04-20 17:57:30 +02:00
5c37ed3a4f Merge branch 'master' into greasepencil-object 2020-04-20 16:52:04 +02:00
a93a4ed23a GPencil: Add HSV randomness to brush
Now it's possible to random the color of the vertex while drawing.
2020-04-20 16:51:25 +02:00
2e22fb6349 Merge branch 'master' into greasepencil-object 2020-04-20 11:52:58 +02:00
8a086068c1 Merge branch 'master' into greasepencil-object 2020-04-19 17:30:38 +02:00
0ea8fa66a6 Merge branch 'master' into greasepencil-object 2020-04-18 16:28:28 +02:00
5f69438514 Merge branch 'master' into greasepencil-object 2020-04-18 13:16:57 +02:00
ca96f90823 Merge branch 'master' into greasepencil-object 2020-04-18 10:54:27 +02:00
ed30fea2b8 Merge branch 'master' into greasepencil-object 2020-04-17 22:04:43 +02:00
9bc7084f6a Merge branch 'master' into greasepencil-object 2020-04-17 19:43:32 +02:00
71582af338 GPencil: Change Y and U keys to use popovers
Instead to use the menus to change Layer and Materials, now the popover is displayed.
2020-04-16 18:51:14 +02:00
94fdfe312b Merge branch 'master' into greasepencil-object 2020-04-16 15:58:43 +02:00
21eda8c460 GPencil: Display preview icon in material select 2020-04-16 15:51:41 +02:00
a44e4c239a Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object 2020-04-16 09:31:28 +02:00
2d847c1de4 Merge branch 'master' into greasepencil-object 2020-04-16 09:31:05 +02:00
a518ec27fc GPencil: Handle 0 materials in material change 2020-04-16 09:29:34 +02:00
04b539d468 GPencil: New options to change active material
This is visible in Contex menu and using U key
2020-04-15 19:23:39 +02:00
2b8d3a5d26 GPencil: Rename operator select_material to material_select 2020-04-15 18:26:02 +02:00
115ef93068 Merge branch 'master' into greasepencil-object 2020-04-15 18:04:24 +02:00
f09ada52fe Merge branch 'master' into greasepencil-object 2020-04-15 10:32:39 +02:00
b239ed63c6 Merge branch 'master' into greasepencil-object 2020-04-14 19:18:33 +02:00
33b8c08443 Merge branch 'master' into greasepencil-object 2020-04-14 19:06:57 +02:00
a240d6463d Merge branch 'master' into greasepencil-object 2020-04-14 12:50:19 +02:00
9591185555 GPencil: Fix small issue in selection
The selection was not consistent inside fill
2020-04-14 11:07:24 +02:00
3e8b73797d Merge branch 'master' into greasepencil-object 2020-04-14 10:10:36 +02:00
26d2570364 GPencil: Backport Random Layer color
Use a single color by object in grease pencil is not practical because is necessary to see all layers.

To tint by layer, the layer tint parameter is used and not the material color as is done in other modes.

This function has been backported from 2.82.
2020-04-14 10:09:38 +02:00
6923885184 Merge branch 'master' into greasepencil-object 2020-04-13 15:54:41 +02:00
5c22e28d81 GPencil: Add turnpolicy parameter to trace
This determines how turn in the trace process. (It uses Potracle lib values)
2020-04-13 12:37:29 +02:00
cec6fcbde6 Merge branch 'master' into greasepencil-object 2020-04-13 10:22:54 +02:00
320981f796 Merge branch 'master' into greasepencil-object 2020-04-11 11:49:40 +02:00
2888a4fa26 Merge branch 'master' into greasepencil-object 2020-04-10 17:30:51 +02:00
60bc5eec36 Gpencil: Cleanup unused code 2020-04-10 11:59:03 +02:00
57c03e6247 Merge branch 'master' into greasepencil-object 2020-04-10 10:55:19 +02:00
92c6f438ec Merge branch 'master' into greasepencil-object 2020-04-10 10:31:15 +02:00
7965577123 GPencil: Resuse exiting layer in trace 2020-04-09 19:40:09 +02:00
0df835f1e7 GPencil: Rename default trace layer and material 2020-04-09 19:37:49 +02:00
6a9f45163e GPencil: Add sample distance to trace 2020-04-09 19:23:27 +02:00
243254bfc6 Merge branch 'greasepencil-object' into gpencil-trace 2020-04-09 16:27:02 +02:00
7eff44bb28 Merge branch 'master' into greasepencil-object 2020-04-09 16:26:26 +02:00
a55bf7e502 GPencil: Set default target frame to current frame 2020-04-09 13:43:18 +02:00
83c6115150 GPencil: Fix poll method 2020-04-09 13:22:16 +02:00
d62750ecf9 GPencil: Add menu for trace and more options 2020-04-09 12:30:35 +02:00
d3035fa79b Merge branch 'greasepencil-object' into gpencil-trace 2020-04-09 11:02:14 +02:00
01bfbc81c7 Merge branch 'master' into greasepencil-object 2020-04-09 10:59:23 +02:00
897df6e8a9 GPencil: Tag main to update after creating a new object 2020-04-08 20:05:16 +02:00
b35a58e987 GPencil: Add color threshold 2020-04-08 19:48:26 +02:00
fc97d6a578 Merge branch 'greasepencil-object' into gpencil-trace 2020-04-08 19:08:13 +02:00
e9ab666f97 Merge branch 'master' into greasepencil-object 2020-04-08 19:06:51 +02:00
cb504a7619 GPencil: Trace curves working 2020-04-08 18:53:32 +02:00
487ca29e61 GPencil: Fixed crash in trace with number of points 2020-04-08 17:20:44 +02:00
7a471d0820 GPencil: More work in trace 2020-04-08 16:49:19 +02:00
10bf4b3503 GPencil: Basic structure of trace
Still is not tracing, but all pieces are in place
2020-04-08 15:49:08 +02:00
b0dee1459e Merge branch 'greasepencil-object' into gpencil-trace 2020-04-08 09:58:28 +02:00
a84384ce1a Merge branch 'master' into greasepencil-object 2020-04-08 08:34:14 +02:00
5323355d63 Include Potrace lib as new extern
Thanks to @lazydodo for his help.
2020-04-07 20:09:53 +02:00
33419bc529 Merge branch 'master' into greasepencil-object 2020-04-07 20:08:49 +02:00
a690fbdd5e Merge branch 'master' into greasepencil-object 2020-04-07 19:42:47 +02:00
f679dfb52a GPencil: Fix return value error 2020-04-07 17:12:31 +02:00
7395f7a004 GPencil: Fix problem with some linked not selected
In some files, the active object is not visible in the selected objects of the view.
2020-04-07 17:10:25 +02:00
a02a57f544 GPencil: Check object type in poll for Bake Animation 2020-04-07 16:06:22 +02:00
64e4adbd39 GPencil: Cleanup unused variable 2020-04-07 11:27:26 +02:00
cc24e6a388 Merge branch 'master' into greasepencil-object 2020-04-07 11:26:31 +02:00
8fee0611c4 Merge branch 'master' into greasepencil-object 2020-04-06 17:24:59 +02:00
501befe2c4 GPencil: Improve Bake Animation to Linked
Also allows to bake several meshes at the same time.
2020-04-06 17:23:56 +02:00
83543d23c2 GPencil: Use BKE function to get mesh_eval 2020-04-06 13:42:38 +02:00
5861c158c6 Merge branch 'master' into greasepencil-object 2020-04-06 11:32:51 +02:00
8b6fd845e9 Merge branch 'master' into greasepencil-object 2020-04-05 18:38:25 +02:00
f2d8e44b65 Merge branch 'master' into greasepencil-object 2020-04-04 11:05:50 +02:00
704811de55 GPencil: Set 3D or 2D mode for baked strokes 2020-04-04 09:38:52 +02:00
3a4977d43e Merge branch 'master' into greasepencil-object 2020-04-03 22:33:29 +02:00
66a64bf43b GPencil: Add option to reproject Mesh Bake 2020-04-03 22:18:47 +02:00
590bf5ea94 GPencil: Cleanup code 2020-04-03 19:48:38 +02:00
ee1613c229 GPencil: Extract reproject funtion to shared module
This funtion can be used in more areas
2020-04-03 19:47:16 +02:00
a8a348a7fa GPencil: Cleanup ScrArea from sa to area 2020-04-03 16:46:42 +02:00
150bc685a4 Merge branch 'master' into greasepencil-object 2020-04-03 16:42:16 +02:00
7267c807c7 GPencil: Add new Keep Original to Reproject strokes 2020-04-03 16:33:32 +02:00
bb1ab0ef05 GPencil: Change Convert Mesh parameter order
This makes more consistent the UI with Bake operator
2020-04-03 15:55:04 +02:00
77e475df75 GPencil: Replace Offset by Stroke Offset in Mesh Convert 2020-04-03 15:51:58 +02:00
70ee6f7e2c GPencil: Change Offset to Stroke Offset in UI 2020-04-03 15:51:12 +02:00
00c41c607b GPencil: Replace Frame Offset by Target Frame
Also some UI changes
2020-04-03 15:48:55 +02:00
e2116ffbf6 GPencil: Add new target object and frame offset parameter to Bake 2020-04-03 14:12:46 +02:00
1ed31e1dc2 Merge branch 'master' into greasepencil-object 2020-04-03 10:00:10 +02:00
d5f589c4c1 GPencil: Remove unused lines 2020-04-02 19:34:30 +02:00
2f963f1c58 GPencil: Fix error in Bake when no mesh is selected 2020-04-02 18:22:52 +02:00
9756b2a46b Merge branch 'master' into greasepencil-object 2020-04-02 16:48:41 +02:00
118fde42f8 GPencil: Make Bake Mesh to use a pop panel to define parameters
Run directly the operator could freeze the UI.
2020-04-02 12:04:56 +02:00
208df77dbd GPencil: Split mesh bake to new source code file 2020-04-02 11:16:25 +02:00
5e729b7381 Merge branch 'master' into greasepencil-object 2020-04-01 19:36:07 +02:00
43d0a57007 GPencil: Remove menu separator 2020-04-01 15:43:27 +02:00
60bf40577e GPencil: Rename operator and add to menu
Also changed end frame to length
2020-04-01 15:43:27 +02:00
a8ed7a0585 GPencil: Export mesh animation to grease pencil
This operator extract a range of frames and convert to grease pencil strokes.
2020-04-01 15:43:27 +02:00
d7dfb1800f GPencil: Avoid double creation of Layers and Materials when converting to Mesh 2020-04-01 15:43:27 +02:00
4fc5883292 Merge branch 'master' into greasepencil-object 2020-04-01 10:03:33 +02:00
bf940653ab GPencil: Remove unused materials after converting mesh 2020-03-31 22:00:46 +02:00
835ac5922d GPencil: Fix convert to Mesh offset to use Normal vector 2020-03-31 20:20:27 +02:00
9d73d038c7 GPencil: Add Offset to Stroke converted and make stronger the thickness 2020-03-31 19:45:34 +02:00
11ac3bf5c3 Merge branch 'master' into greasepencil-object 2020-03-31 18:55:17 +02:00
e2a7a0eece GPencil: New Bevel parameter when convert to Curve 2020-03-31 18:38:50 +02:00
57ced8cf24 Merge branch 'master' into greasepencil-object 2020-03-31 17:03:44 +02:00
bc44dd8dbd GPencil: Small tweaks to Convert UI panel 2020-03-31 16:57:28 +02:00
8d097f7194 GPencil: Add option to disable Faces conversion from mesh 2020-03-31 16:49:16 +02:00
3f59135c11 GPencil: Export only Seam Edges 2020-03-31 16:28:05 +02:00
ab20e3d9cb GPencil: New Thickness and Angle params in Convert Mesh 2020-03-31 16:07:41 +02:00
a2fb5a3747 Merge branch 'master' into greasepencil-object 2020-03-31 13:12:16 +02:00
47b01a4d9f GPencil: Increase valid angle for edgeloops
Now it's 70 degrees.
2020-03-31 13:11:38 +02:00
ba73350932 GPencil: Use materials for mesh converted instead of Vertex Color 2020-03-31 13:09:05 +02:00
95e30ca2df GPencil: Fix Tint tool in default template
The brush was not set and the Tint tool did not work.
2020-03-31 12:39:47 +02:00
e831685942 GPencil: Fix memory leak 2020-03-31 12:30:02 +02:00
d6f7f22974 Merge branch 'master' into greasepencil-object 2020-03-30 19:01:30 +02:00
07ecc94133 Merge branch 'master' into greasepencil-object 2020-03-30 18:27:21 +02:00
fd003d721c Merge branch 'master' into greasepencil-object 2020-03-30 17:59:31 +02:00
e4a8dcf64c Merge branch 'master' into greasepencil-object 2020-03-30 16:48:21 +02:00
98058973d0 GPencil: Improve Mesh to GPencil edge conversion
Now the strokes are done using edge loop calculated.
2020-03-30 16:47:36 +02:00
4a9835b629 Merge branch 'master' into greasepencil-object 2020-03-29 18:06:07 +02:00
5907e16c48 GPencil: Convert Mesh to GPencil
New option to convert a mesh to a 3D grease pencil object.
2020-03-29 18:05:12 +02:00
b2f20a139b Merge branch 'master' into greasepencil-object 2020-03-28 15:08:48 +01:00
4edd76c992 Merge branch 'master' into greasepencil-object 2020-03-27 16:51:20 +01:00
5bafcd7fa9 Merge branch 'master' into greasepencil-object 2020-03-27 11:12:25 +01:00
568c4b8209 GPencil: Fix error selecting with Box and Lasso 2020-03-27 11:09:02 +01:00
0aa979ce2f GPencil: Cleanup Clang format 2020-03-27 10:20:44 +01:00
be5a32665c Merge branch 'master' into greasepencil-object 2020-03-27 10:15:20 +01:00
e12d75af8c Merge branch 'master' into greasepencil-object 2020-03-26 13:17:40 +01:00
265b781b16 Merge branch 'master' into greasepencil-object 2020-03-26 12:00:28 +01:00
63bb8a71bb GPencil: Improve randomness while drawing
The interpolated points added automatically were not random.

Also improved the UV randomness to get more variations.
2020-03-26 11:59:50 +01:00
f976859398 Merge branch 'master' into greasepencil-object 2020-03-26 09:51:05 +01:00
bfcf9d3092 GPencil: Change Tweak select tool for Fill strokes
The code has been simplified, some boundbox check added and reduce the gap for selection.
2020-03-25 19:59:12 +01:00
a1451d3b72 Merge branch 'master' into greasepencil-object 2020-03-25 18:47:21 +01:00
6074eafe61 GPencil: Make UV random equals to UV Noise 2020-03-25 12:19:34 +01:00
b10ea6f3a0 GPencil: Change Jitter to be more hard and work in vertical lines
Before the jitter was not working in vertical lines.
2020-03-25 11:51:59 +01:00
44a6b48693 Merge branch 'master' into greasepencil-object 2020-03-24 17:08:17 +01:00
65b78b63fc GPencil: Improve select to detect fill areas
Now if use Tweak, Box or Lasso select inside a filled area, the whole stroke is selected if no point is selected before.
2020-03-24 13:20:23 +01:00
10db76e9ff Merge branch 'master' into greasepencil-object 2020-03-24 10:55:10 +01:00
879e7c5387 Merge branch 'master' into greasepencil-object 2020-03-23 17:31:05 +01:00
f9258097a4 Merge branch 'master' into greasepencil-object 2020-03-21 09:51:52 +01:00
085541f933 Merge branch 'master' into greasepencil-object 2020-03-19 11:39:00 +01:00
0b5568e0ef Merge branch 'master' into greasepencil-object 2020-03-19 08:39:39 +01:00
ac784678c1 Merge branch 'master' into greasepencil-object 2020-03-18 18:04:32 +01:00
f450bdee6d Merge branch 'master' into greasepencil-object 2020-03-17 17:29:20 +01:00
3ac8b9c85e GPencil: Cleanup matrix multiplication 2020-03-17 16:46:50 +01:00
99a4dd8c59 GPencil: Simplify Parent to Layer code and solve issue with bones 2020-03-17 16:42:54 +01:00
446472a490 GPencil: Fix Snap cursor to Selected
It was using the original data and must use the evaluated data.
2020-03-17 12:17:48 +01:00
99a5522a8a GPencil: Fix Parent layer not working 2020-03-17 12:17:42 +01:00
f7cd2c9ff5 Merge branch 'master' into greasepencil-object 2020-03-17 12:17:28 +01:00
03da90d926 Merge branch 'master' into greasepencil-object 2020-03-15 11:20:02 +01:00
d4ccda4422 Merge branch 'master' into greasepencil-object 2020-03-13 10:34:19 +01:00
acf320a004 Merge branch 'master' into greasepencil-object 2020-03-11 17:00:33 +01:00
6e9159a776 Merge branch 'master' into greasepencil-object 2020-03-10 09:01:51 +01:00
3d8cf2ddb9 Merge branch 'master' into greasepencil-object 2020-03-09 16:31:13 +01:00
2693010956 Merge branch 'master' into greasepencil-object 2020-03-09 16:18:12 +01:00
6c3e2749e4 GPencil: Fix error after merge 2020-03-09 16:13:50 +01:00
e1f84c329a Merge branch 'master' into greasepencil-object 2020-03-09 16:10:43 +01:00
1c383cd935 Merge branch 'master' into greasepencil-object 2020-03-09 08:52:35 +01:00
fb362e6476 Merge branch 'master' into greasepencil-object 2020-03-08 11:09:16 +01:00
5b3670acb4 GPencil: Use Curve when normalize opacity 2020-03-07 17:29:07 +01:00
002f53cc87 GPencil: Add Normalize Opacity to Opacity modifier 2020-03-07 17:15:24 +01:00
c96b1127f0 GPencil: Change Custom Curve tooltip in modifiers 2020-03-07 16:21:31 +01:00
505494062c GPencil: Fix more compiler warnings 2020-03-07 12:42:11 +01:00
cf86167e6c GPencil: Fix compiler warnings 2020-03-07 12:24:53 +01:00
e1abb1b6ae GPencil: Only init materials for 2D template 2020-03-07 11:54:14 +01:00
d4744d120e Fix T74477: Onion opacity not working
Also adjust the low limit when opacity is > 0. This allows to see all frames when the opacity is very low.
2020-03-07 11:12:33 +01:00
6d7255a530 Merge branch 'master' into greasepencil-object 2020-03-07 10:47:23 +01:00
b34b22a81f Merge branch 'master' into greasepencil-object 2020-03-06 22:07:28 +01:00
ce63cc6b8b GPencil: Add custom curves to some modifiers
This allows to customize the effect along the stroke.
2020-03-06 22:03:37 +01:00
1aa70c9b21 GPencil: Fix errors after merge 2020-03-06 17:52:10 +01:00
6e58098a9f Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
	source/blender/draw/engines/gpencil/gpencil_engine.c
	source/blender/editors/gpencil/drawgpencil.c
	source/blender/editors/gpencil/gpencil_fill.c
	source/blender/editors/gpencil/gpencil_interpolate.c
	source/blender/editors/gpencil/gpencil_paint.c
	source/blender/editors/gpencil/gpencil_sculpt_paint.c
	source/blender/editors/gpencil/gpencil_utils.c
2020-03-06 17:41:52 +01:00
c2c8a3ecfd GPencil: Remove unused DRW_gpencil_freecache() function
This free function was used in the old implementation, but in the new produces crashes when deleting an object.
2020-03-06 17:37:03 +01:00
9d742a0e04 GPencil: Remove Angle Split from Multistroke Modifier
This function is not clear how use it and it's getting segment faults. As the original developer that knows the function is not available, we remove the function and pending of adding in the future.
2020-03-06 17:34:48 +01:00
95b375926b GPencil: Fix stroke duplication error in Fill data 2020-03-06 17:09:16 +01:00
2cba59878f GPencil: Cleanup alloc memory name 2020-03-06 16:10:33 +01:00
a187906642 GPencil: Fix memory crash when delete objects 2020-03-06 13:37:54 +01:00
52b518bf49 GPencil: Fix error after merge 2020-03-06 12:45:16 +01:00
1bebdfbebd GPencil: Fix missing line after merge 2020-03-06 12:40:16 +01:00
734cd46691 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/object.c
	source/blender/blenkernel/intern/scene.c
2020-03-06 12:39:14 +01:00
c8db05b384 GPencil: Change Noise modifier UI
To have all factors in one line makes very difficult to see the values when the panel is narrow.
2020-03-06 12:36:16 +01:00
84ccdceb15 GPencil: Fix segment fault in Noise modifier
The random noise table used was wrong.
2020-03-06 11:57:29 +01:00
2ca20b8282 GPencil: Fix Build modifier error in end frame calculation 2020-03-06 10:16:13 +01:00
a0fac1be8c GPencil: Fix compiler warnings 2020-03-06 10:12:34 +01:00
2b1937cf47 GPencil: Fix errors after merge 2020-03-06 08:51:04 +01:00
83233d2605 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
	source/blender/editors/gpencil/gpencil_paint.c
	source/blender/editors/gpencil/gpencil_sculpt_paint.c
	source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
2020-03-06 08:41:34 +01:00
a4bfe62679 GPencil: Fix texture not appearing in render 2020-03-06 01:52:29 +01:00
ea4cc817d1 GPencil: Modifier: Simplify: Fix modifier distance and length property feel
This reduce the rate of increase and unlock the range of the props.
2020-03-06 01:33:44 +01:00
3224950b2d GPencil: Modifier: Fix smooth factor range 2020-03-06 01:18:31 +01:00
c64c5185d5 GPencil: Modifier: Noise: Replace Full Stroke option by Noise Scale
This means the noise can ba scaled along the strokes to create more
varied effects.
2020-03-06 01:04:37 +01:00
c34596a3bb GPencil: Fix potential out of bound read in Noise modifier 2020-03-06 00:10:11 +01:00
63f6b9c018 GPencil: Modifier: Use unique seed for each stroke for Noise modifier
This is needed to avoid the repeating pattern accross duplicated strokes.
2020-03-06 00:01:20 +01:00
eb5a25f4bc GPencil: Modifier: Cleanup Multiple Stroke modifier UI & code
- Reverse Opacity influence.
- Use BLI_listbase function to merge list (fixing a memleak)
- Some minor codestyle changes
2020-03-05 23:49:06 +01:00
f447901275 Fix T74476: Crash when interpolate GPencil sequence
The stroke totpoints was not updated.
2020-03-05 23:24:15 +01:00
d369d779f6 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/object.c
2020-03-05 21:59:52 +01:00
bb6dedfc84 GPencil: Remove double curve initialization 2020-03-05 19:31:09 +01:00
93bae8e213 GPencil: Change Default values and Curve for Noise modifier. 2020-03-05 19:02:16 +01:00
67408ac939 GPencil: Modifier: Rework Array modifier's RNG for better random variation
Use a mix of low decrepency sequence with a special sin rand function
to avoid repeating patterns. This should suffice in most cases
2020-03-05 18:29:33 +01:00
d56b73af86 GPencil: Fix missing Noise curve for old files 2020-03-05 18:09:02 +01:00
9d4408f7a9 GPencil: Add Object name to Array and Noise seed generation 2020-03-05 18:04:51 +01:00
c59b50c80c GPencil: Fix missing factor adjustment in previous commit 2020-03-05 18:02:10 +01:00
c300e826d0 GPencil: Divide old Noise factor to adapt to new logic
The old values were too high.
2020-03-05 17:58:13 +01:00
141c4b509e GPencil: Fix missing break in switch case 2020-03-05 17:42:23 +01:00
7e0b48e58f GPencil: Fix rebase error 2020-03-05 17:40:35 +01:00
908dfbf618 GPencil: Modifier: Change Noise Modifier behavior
- Noise is applied using a different factor for each property.
- Move Extremes is replaced by a custom curve profile
- Each modifier will create a different result, making stacking possible.
- The result of the position noise will not make the stroke curl.
- Noise default instensity has been tweaked for every property type.
2020-03-05 17:35:05 +01:00
6cfac67df6 GPencil: Modifier: Improve UI of offset modifier 2020-03-05 17:35:05 +01:00
7098b638f2 GPencil: More changes to Array randomness
Now the random does not use an array of random values.
2020-03-05 17:30:25 +01:00
579eeb547f GPencil: Replace title for Replace Thickness
After talking with @pablovazquez, @mendio and @pepeland, the name Uniform Thickness defines better what this parameter does.
2020-03-05 16:14:39 +01:00
88d67b6c6d GPencil: Revert Opacity/Tint limit of 1.0 for factor
The values above 1.0 allow to force a full opacity for strokes with not enough strength
2020-03-05 14:34:40 +01:00
b4d7c6b0b8 GPencil: Cleanup Versioning loops 2020-03-05 11:07:25 +01:00
4ab8a84d0e GPencil: Version Bump and prepare versioning code 2020-03-05 10:46:45 +01:00
53aa4193cf GPencil: Fix errors after merge due function renaming 2020-03-05 10:31:26 +01:00
914f6b686a Merge branch 'master' into greasepencil-object 2020-03-05 10:27:51 +01:00
fd088d6039 GPencil: Fix inverted blend of weight paint
The weight was applied inverted from center of brush.
2020-03-05 10:27:13 +01:00
928665b919 GPencil: Add missing recalc of bounding box in Array modifier
Also some code cleanup and fix compiler warnings
2020-03-05 10:24:50 +01:00
affe9e0b92 Pencil: Modifier: Change Thickness modifier behavior
Normalize option is now Replace Thickness.
A separate factor is used when switching to relative mode.

Custom Curve profile is also applied in replace thickness mode to shape
the profile.

Simplify the modifier code by only modifying the pt->pressure.
2020-03-05 00:11:23 +01:00
d503af9a61 Merge branch 'master' into greasepencil-object 2020-03-04 22:12:25 +01:00
b7a4e43800 GPencil: Move seed below Random factors 2020-03-04 20:41:10 +01:00
6c8d17b75f GPencil: Change Array modifier
Now the randomness works totally different in a more predictable way.
2020-03-04 20:29:10 +01:00
94172a5391 GPencil: Modifier: Unlock range of Saturation and Value in HSV modifier 2020-03-04 19:26:34 +01:00
33c0861db8 GPencil: Modifier: Fix UI of Tint and Opacity modifiers 2020-03-04 19:22:06 +01:00
7194a1acdd GPencil: Fix compiler warnings 2020-03-04 18:30:02 +01:00
54798961ff GPencil: Fix stroke textures not working because of material chunk reuse 2020-03-04 18:15:32 +01:00
a520f09bb8 Merge branch 'master' into greasepencil-object 2020-03-04 16:37:14 +01:00
ea16bb622a GPencil: Fix sbuffer rendering twice when using onion skinning 2020-03-04 16:06:36 +01:00
45647e2be3 GPencil: Fix occlusion bug when using multiple material 2020-03-04 16:06:36 +01:00
9ad6fb8363 GPencil: Cleanup - avoid the term old when storing/restoring context variables 2020-03-04 12:04:03 +01:00
de5aca79ae Merge branch 'master' into greasepencil-object 2020-03-04 11:07:08 +01:00
bb74f6cc91 GPencil: In Vertex Paint mode, Solid Vertex must be set always
In Vertex Paint mode, the Solid shading must be always Vertex
2020-03-03 19:38:02 +01:00
13039a1b65 GPencil: Set Solid mode to Material in 2D template 2020-03-03 19:31:37 +01:00
f634f753c8 Merge branch 'master' into greasepencil-object 2020-03-03 19:06:02 +01:00
2e23814ab6 GPencil: Disable VFX in Material shding mode
The VFX must be visible only in Render mode, as Lights.
2020-03-03 19:04:37 +01:00
0272501fbd GPencil: Fix Modifiers patching
Also added a DNA check to avoid double patching for files created with development versions
2020-03-03 11:23:09 +01:00
e03027e168 Merge branch 'master' into greasepencil-object 2020-03-03 10:21:07 +01:00
a83924fa1b Merge branch 'master' into greasepencil-object 2020-03-03 08:31:37 +01:00
5d1bf00283 GPencil: Don't hide cursor in Weight and Vertex Paint
The cursor must be visible all the time
2020-03-02 18:57:17 +01:00
97db5aa077 GPencil: Fix errors after merge 2020-03-02 16:29:31 +01:00
18ba1269a5 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenkernel/BKE_gpencil.h
	source/blender/blenkernel/BKE_gpencil_modifier.h
	source/blender/editors/include/ED_gpencil.h
2020-03-02 16:23:15 +01:00
031d1a2da1 GPencil: Disable Stroke in Solid Fill default material 2020-03-02 16:20:16 +01:00
1731c93ed0 GPencil: Rename material Boxes Stroke to Squares Stroke 2020-03-02 16:16:18 +01:00
56d703dc08 GPencil: Fix Use cursor Popover
- Fix color in modes not used.
- Enable cursor by default.
2020-03-02 16:13:12 +01:00
69e1f2b86d GPencil: Remove Substract color for Weight Paint brush
This is not used now.
2020-03-02 16:01:40 +01:00
7cde506c3c GPencil: Fix struct alignment error after merge 2020-03-02 13:32:39 +01:00
94e24b7e42 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/makesdna/DNA_brush_types.h
2020-03-02 13:27:07 +01:00
7ae3011e91 Merge branch 'master' into greasepencil-object 2020-03-01 19:01:47 +01:00
f5bafbfede GPencil: Fix Animation menu
The old animation menu is enough and don't need a new Keyframe menu
2020-03-01 18:58:41 +01:00
90a5c6e436 GPencil: Cleanup text 2020-03-01 17:26:14 +01:00
d220db9ae0 GPencil: Move Active Layer to Grease Pencil menu in Edit mode
More tweaks to menus
2020-03-01 17:18:20 +01:00
2225dc0cb1 GPencil: Change Caption of Active Layer menu 2020-03-01 17:03:43 +01:00
45ada6c9a9 GPencil: Fix double menu when change active layer 2020-03-01 16:59:48 +01:00
7e082735ac GPencil: Replace Options menu with old menus
Add the options to existing menu.
2020-03-01 16:25:00 +01:00
7a3125dcb4 GPencil: Undo Options menu 2020-03-01 16:18:55 +01:00
af2b1a0e7f GPencil: Add new menu Options for new menus
The name is the initial idea, but we need a better name and maybe add more options.
2020-03-01 10:52:26 +01:00
6f0549b539 GPencil: Split Keyframe menu to i key from context menu
Now it's not in the context menu
2020-03-01 09:21:44 +01:00
a797eb8deb GPencil: Add Frame options to Vertex and Weight paint context menu 2020-02-29 20:16:26 +01:00
98b408f82f GPencil: Reformat context menu and change frame text 2020-02-29 20:07:40 +01:00
1ba10aaea4 GPencil: Include change Layer in all modes and set to Y key 2020-02-29 17:57:20 +01:00
ea19fe3b13 GPencil: Add M key to switch layer in Draw Mode 2020-02-29 11:34:39 +01:00
989be48d83 GPencil: Fix missing Weight Paint context menu 2020-02-29 11:21:26 +01:00
61e4bfc385 GPencil: Fix missing Sculpt context menu 2020-02-29 11:13:55 +01:00
cbf9cfb5a8 GPencil: New Layer selector in Draw context menu 2020-02-29 11:11:32 +01:00
8c266669ec GPencil: Fix struct align after merge 2020-02-28 22:55:09 +01:00
b77051b5fc Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/makesdna/DNA_brush_types.h
2020-02-28 22:49:53 +01:00
7d5feee4c2 GPencil: Fix selected line when layer is locked
This solves the edit points and line selected when the layer is locked.
2020-02-28 22:36:12 +01:00
04c3f8183b GPencil: Fix Ghost points in edit mode 2020-02-28 20:34:37 +01:00
52390dc13e GPencil: Don't show NO_FILL strokes with Fill
These are special strokes to close Fill gaps.
2020-02-28 19:09:28 +01:00
bec545c678 Merge branch 'master' into greasepencil-object 2020-02-28 16:37:47 +01:00
b6025e1a0b GPencil: Improve Array random offset calculation
Now the randomness cannot be greater that the segment (constant or bounding box).
2020-02-28 16:36:21 +01:00
fd43f143e5 GPencil: Add seed to Array modifier 2020-02-28 11:09:08 +01:00
18f3e5f565 GPencil: Implement random offset in Array modifier
Still pending define a variable seed
2020-02-28 09:49:51 +01:00
43478ed0fd GPencil: More UI tweaks in modifiers
- Change Subdivision to Subdivide in modifier name.
- Replace text level by subdivisions.
- Remove icons in Noise and Smooth buttons.
2020-02-28 08:50:02 +01:00
a1cebabef2 Merge branch 'master' into greasepencil-object 2020-02-28 08:43:22 +01:00
62cc4edf96 GPencil: Fix missing tag when change a material
The new draw engine need to tag all GP Objects.
2020-02-27 20:12:55 +01:00
24cce14c00 GPencil: Change defaults for Array modifier
- Enable relative offset by default
- Change units for relative offset
2020-02-27 19:58:40 +01:00
1ee5236c8c GPencil: Change Array modifier to use Relative Offset
The old shift parameter was related to Instances, but not as array.
2020-02-27 19:50:43 +01:00
f971481dc9 GPencil: Cleanup unused code 2020-02-27 18:28:14 +01:00
6e9cccc91f Merge branch 'master' into greasepencil-object 2020-02-27 17:49:07 +01:00
626064addc GPencil: Update Topbar popover color using palette
Now when select a color, the popover color is updated.

Fix by Julian Eisel
2020-02-27 17:29:42 +01:00
cb73de0e58 GPencil: Changes in panels of Vertex Paint mode
Remove duplicated color and change titles
2020-02-27 16:27:14 +01:00
b770e6e0f4 GPencil: More tweaks to Vertex Color panels 2020-02-27 16:22:44 +01:00
bab63f382e GPencil: Remove duplicated code 2020-02-27 14:27:49 +01:00
6b27306982 Merge branch 'master' into greasepencil-object 2020-02-27 14:24:15 +01:00
3d7b3954f8 GPencil: Changes to Header of the Vertex Color panel
We need see the panel in Material mode.
2020-02-27 14:21:59 +01:00
c3f0b0ff43 GPencil: Remove double color swatch in popover 2020-02-27 12:48:21 +01:00
01b4fa27c6 GPencil: Move Vertex option to bottom of Popover
It's better to have the color at top and the params at the bottom.
2020-02-27 12:40:04 +01:00
9ddf7ea39c GPencil: Change Multiple Strokes modifier split angle to PROP_ANGLE 2020-02-27 12:25:05 +01:00
ceb40f9c9b GPencil: Change Popover to use Color header 2020-02-27 11:38:00 +01:00
e8e7b30a94 GPencil: New prop_with_popover template
Created by Julian Eisel
2020-02-27 11:37:44 +01:00
d61b9c3e7d GPencil: Fix opacity in Multiply Modifier
The value was inverted.
2020-02-27 11:00:57 +01:00
4ed65048ef GPencil: Add switches to Array modiifer
New switches to enable Offset, Shift and Object transform.
2020-02-27 10:55:38 +01:00
dcdf3a64c8 Merge branch 'master' into greasepencil-object 2020-02-27 08:46:25 +01:00
ce59c7da18 GPencil: Enable edit mode in modifiers if Edit is supported
Some modifiers cannot be used in edit mode.
2020-02-27 08:45:22 +01:00
4a2aefb43d Merge branch 'master' into greasepencil-object 2020-02-26 20:10:08 +01:00
94ecf6a8ee GPencil: Fix tooltip typo 2020-02-26 20:07:29 +01:00
e497cbefae GPencil: Replace Enable Fading with Enable Fade
Also changed property name
2020-02-26 20:05:15 +01:00
9efc53b7b8 GPencil: Change default name of Vertex Color modifier 2020-02-26 20:01:29 +01:00
12170e057a GPencil: Enable modifiers visible in Edit mode by default 2020-02-26 19:58:07 +01:00
89b30af4b2 GPencil: Replace Vertex Color ON/OFF by Enum
The old switch looked that disable the colors instead to change of mode.
2020-02-26 19:46:51 +01:00
c38655538b GPencil: UI - Replace Duplications with Duplicates 2020-02-26 19:07:04 +01:00
b832698377 GPencil: UI - Replace Add GP modifier eith Add modifier 2020-02-26 19:02:16 +01:00
b3bb17fe75 GPencil: Fix crash when rendering in new window
This was caused by an incorrect context switch.
2020-02-26 18:55:49 +01:00
e58facf432 GPencil: UI - Remove Vertex Color text from popover 2020-02-26 18:08:58 +01:00
257ea65812 GPencil: UI - Smooth modifier replace Step with Repeat 2020-02-26 18:06:13 +01:00
9159309c17 GPencil: UI - Replace Object by Mirror Object 2020-02-26 18:03:18 +01:00
604d907025 GPencil: Fix typo error 2020-02-26 17:38:17 +01:00
1e993d2b78 GPencil: Cleanup more loops with FOREACH macro 2020-02-26 16:06:39 +01:00
d0e081cfe6 GPencil: Cleanup loops using macro FOREACH 2020-02-26 10:42:37 +01:00
7f03239193 Merge branch 'master' into greasepencil-object 2020-02-26 09:27:58 +01:00
a9f31085b6 Merge branch 'master' into greasepencil-object 2020-02-25 19:21:53 +01:00
b777427234 GPencil: Cleanup loops and replace by macros 2020-02-25 18:00:12 +01:00
f3cb11ea7a GPencil: Fix Array modifier order and remove Keep on Top
There is one limitation in the order. As the Layer position is on top of array element, if the object has several layers, the order is by layer. To keep the full object on back, merge all layers in one of the original object.
2020-02-25 17:52:33 +01:00
2b9e6f95b0 GPencil: Reorganize Array modifier code
Still pending foix the sort issue.
2020-02-25 17:52:23 +01:00
a2133ba0b8 Merge branch 'master' into greasepencil-object 2020-02-25 15:46:38 +01:00
c4ed124d67 GPencil: Fix time modifier
After the change of the loop, the time modifier was not evaluated.
2020-02-25 12:50:18 +01:00
f9d47e92e7 GPencil: Fix crash when Sculpt with Grab brush in an empty frame
As the copy of the frame is done after the eval data is used, it could be possible the first time the stroke is not available.
2020-02-25 11:37:16 +01:00
eacb3de0f7 GPencil: Change evaluation order for modifiers
Now the loop of modifiers is done before the loop of layers. This will be required to make changes in array modifier and it's more logic.
2020-02-25 11:10:07 +01:00
6ecd31814f Merge branch 'master' into greasepencil-object 2020-02-25 08:16:47 +01:00
b4200f8da4 Merge branch 'master' into greasepencil-object 2020-02-24 18:59:15 +01:00
2f7f49216a GPencil: Fix distance problems in Vertex Color modifier
Also, the fill is modulate with the distance
2020-02-24 18:07:16 +01:00
57511b3eb1 GPencil: Cleanup - Remove unused code 2020-02-24 17:26:31 +01:00
e03cfb8bea GPencil: Use Material color if not Vertex color for modifier 2020-02-24 17:25:16 +01:00
ca4c8cd886 GPencil: Some small tweaks to Filters in modifier panels 2020-02-24 16:16:32 +01:00
278a784c3b GPencil: Change props to PROP_FACTOR 2020-02-24 16:04:51 +01:00
ef213f1b40 GPencil: Avoid query depsgraph for every point while drawing
Now, the evaluated object is calculated before.
2020-02-24 11:12:01 +01:00
7624567448 GPencil: Fix missing texture in first stroke
The material id was not updated in eval data.
2020-02-24 10:45:59 +01:00
85846970e5 GPencil: Cleanup duplicated code 2020-02-24 09:59:49 +01:00
c825dc6b86 GPencil: Fix problem with first stroke color
When use a new material, the color only changed after first stroke. This was related to the tag of the depsgraph that is done only at the end of drawing due perfromance and fast response.

Now, the value is copied to the runtime data.
2020-02-24 09:50:09 +01:00
fe66b0db99 GPencil: Cleanup Vertex Color maths 2020-02-23 20:03:21 +01:00
fae1d16eb2 Merge branch 'master' into greasepencil-object 2020-02-23 18:27:47 +01:00
32d2d5a21d GPencil: Fix Vertex Color modifier
Solved belnding problems and code cleanup
2020-02-23 18:24:46 +01:00
a1810fae58 GPencil: Reorganize Masking parameters in modifiers
- Removed duplicated code
- Make more compact the list
2020-02-23 17:42:12 +01:00
3317cb9804 GPencil: Fix array modifier rotation bug 2020-02-23 16:41:34 +01:00
23c2dc5bb3 GPencil: Fix HSV modifier
The HSV formula was wrong
2020-02-23 14:28:16 +01:00
197f62c6fd Merge branch 'master' into greasepencil-object 2020-02-23 13:11:33 +01:00
c23e1b6efa GPencil: UI changes to Array modifier
- Replace Material by Material Override.
- Remove the separator between the rotation/scale triples and the random property.
- Add a separator after the rotation/scale props.
2020-02-23 13:11:05 +01:00
333e92f3d3 GPencil: Change Simplify RDP tooltip 2020-02-23 12:55:26 +01:00
0a9d5c1006 GPencil: Patch Subdivision Simple option and fix buf in Tint patching 2020-02-23 12:45:59 +01:00
0609ca4e80 GPencil: Change Subdivision Simple mode to more clear UI 2020-02-23 12:41:13 +01:00
a18d264bf7 GPencil: Change Tint modifier
-   Change factor increment to 0.01 and precision 2.
2020-02-23 11:42:54 +01:00
d5aa66aa08 GPencil: Change Opacity modifier
- Replace UI text.
- Change factor increment to 0.01 and precision 2.
2020-02-23 11:41:49 +01:00
c2b01503ae Merge branch 'master' into greasepencil-object 2020-02-22 16:23:36 +01:00
c4479f6bcc Merge branch 'master' into greasepencil-object 2020-02-21 17:04:45 +01:00
674d61a689 Merge branch 'master' into greasepencil-object 2020-02-21 10:05:24 +01:00
9ac1c6b8cd Merge branch 'master' into greasepencil-object 2020-02-20 14:51:49 +01:00
52e1261970 Merge branch 'master' into greasepencil-object 2020-02-20 10:29:10 +01:00
d1fbbb1653 Merge branch 'master' into greasepencil-object 2020-02-20 09:04:12 +01:00
390d878500 GPencil: Change RIM default blend mode to Overlay 2020-02-19 22:57:27 +01:00
2400bc21ca GPencil: Fix default value for Palette sorting 2020-02-19 22:55:04 +01:00
f68b060bf3 Merge branch 'master' into greasepencil-object 2020-02-19 22:45:01 +01:00
a9e27f071e GPencil: Fix errors creating brushes after merge 2020-02-19 22:21:10 +01:00
29943e3ae8 Merge branch 'master' into greasepencil-object 2020-02-19 20:23:02 +01:00
5d0c1dde8a Merge branch 'master' into greasepencil-object 2020-02-19 20:10:33 +01:00
f512890d89 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/makesdna/intern/dna_rename_defs.h
2020-02-19 19:17:13 +01:00
191118c9f3 GPencil: Invert luminance sorting for lighter to darker 2020-02-19 18:06:09 +01:00
d76e64aad4 GPencil: Add new Value and Luminance sorting for Palettes 2020-02-19 18:02:02 +01:00
921cb2d634 GPencil: Change Palette Sort by menu texts 2020-02-19 17:33:00 +01:00
5aed8a03eb GPencil: Replace Palette sort buttons by Menu 2020-02-19 11:53:47 +01:00
6547fdabd8 Merge branch 'master' into greasepencil-object 2020-02-19 10:57:13 +01:00
f07962df94 GPencil: Fix extract palette from vertex color bug with linear colors
The extract was not converting linear into sRGB for palettes.

Also added missing menu option in Materials menu.
2020-02-18 20:05:53 +01:00
35e1e97a1f Merge branch 'master' into greasepencil-object 2020-02-18 15:25:11 +01:00
e6b9e248ef GPencil: Fix eyedropper color conversion
This was removed by error.
2020-02-18 13:47:35 +01:00
384ec2c342 GPencil: Fix renamed functions after merge 2020-02-18 11:16:34 +01:00
3029b6ec5a Merge branch 'master' into greasepencil-object 2020-02-18 11:13:13 +01:00
289138f4fe Merge branch 'master' into greasepencil-object 2020-02-18 09:08:36 +01:00
a8aea3533f GPencil: Fix double rendering when using workbench as target engine 2020-02-18 00:28:34 +01:00
f506f0296a Merge branch 'master' into greasepencil-object 2020-02-17 20:15:43 +01:00
0cbcc21a3b GPencil: Don't create frame with eraser
Eraser only erase, but never adds a new frame.
2020-02-17 19:42:38 +01:00
dd793b21da GPencil: Fix Blend and Glow Under problems 2020-02-17 18:58:55 +01:00
300152c7d4 GPencil: More tweaks to default parameters for Glow VFX 2020-02-17 17:42:19 +01:00
d1b8692749 GPencil: Use opacity in Glow blend equation 2020-02-17 17:34:11 +01:00
7700117b62 GPencil: Pass Glow color as vec4 2020-02-17 17:27:49 +01:00
3e3c442d85 GPencil: More changes to Blend modes in Glow 2020-02-17 17:24:11 +01:00
f7bc2d1abe GPencil: Patch old Glow effect setting size and opacity 2020-02-17 17:23:56 +01:00
3a39d8f866 GPencil: UI - Put Threshold before Glow color 2020-02-17 17:18:38 +01:00
64d2b73932 GPencil: Change Glow Radius to Size X/Y 2020-02-17 17:14:44 +01:00
5aa2fa4fe0 GPencil: Cleanup code 2020-02-17 16:55:05 +01:00
02c1eb15d0 GPencil: Disable Glow Under if Regular mode is selected 2020-02-17 16:54:11 +01:00
7e59389884 GPencil: More changes to Glow Blend modes
Still some issues
2020-02-17 16:39:37 +01:00
646b796738 GPencil: Set destination layer active after merge layers
If the destination layer is not set as active, the next operation will create a layer because no active layer.
2020-02-17 16:09:26 +01:00
76f01df6e8 Merge branch 'master' into greasepencil-object 2020-02-17 14:30:28 +01:00
d557886ec5 GPencil: New option to paste strokes on back
Sometimes you want paste all strokes behind the copied one.
2020-02-17 11:30:44 +01:00
adc1c8b82f Merge branch 'master' into greasepencil-object 2020-02-17 10:52:33 +01:00
207f9d4df6 GPencil: Fix unreported move to layer with lock material
The strokes with the material locked could be moved. Now the lock is respected.
2020-02-17 10:49:27 +01:00
821d635e8d Merge branch 'master' into greasepencil-object 2020-02-17 09:11:44 +01:00
165118c28b Merge branch 'master' into greasepencil-object 2020-02-16 20:09:05 +01:00
6c1f357c2a GPencil: Make rotation angle allows negative values
Use only positive values only rotate in one direction
2020-02-16 20:08:22 +01:00
a4063358ef GPencil: More changes to add Blend modes to Glow
Still not working.
2020-02-16 20:07:13 +01:00
a3d4a6ad9f GPencil: Disable Glow Blend mode when Glow Under mode is set 2020-02-16 13:05:09 +01:00
6a4d12c2bb GPencil: Remove Mask invert icons 2020-02-16 12:22:59 +01:00
d1c089ef8d GPencil: Add new Blend parameter to Glow effect
Still pending the implementation. This commit only adds the parameter in the UI.
2020-02-15 19:18:46 +01:00
1e2fedd15e GPencil: New Glow rotation parameter
Similar to Blur rotate parameter.
2020-02-15 19:02:03 +01:00
9c2bc5de4e GPencil: Cleanup function using SWAP macro 2020-02-15 16:22:45 +01:00
e457e6fd05 GPencil: Set collision box aligned to axis
If the box was not aligned, the detection fails.
2020-02-15 16:15:27 +01:00
53da19d279 GPencil: Add RNA properties for stroke bound box 2020-02-15 15:41:10 +01:00
38de54c1ed GPencil: Cleanup unused code 2020-02-15 13:54:10 +01:00
1650c1b4b4 GPencil: Remove old parameters from presets templates 2020-02-15 13:41:49 +01:00
ef9d638ffb GPencil: Cleanup formating issue 2020-02-15 13:29:12 +01:00
0a540d273e GPencil: Remove unused define 2020-02-15 10:19:30 +01:00
22a82cad06 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_engine.h
	source/blender/draw/engines/overlay/overlay_extra.c
2020-02-15 10:17:06 +01:00
e21c6c5785 GPencil: Disable VFXs in Solid mode
The VFX must be visible in Material or Render shading mode only.
2020-02-15 10:13:39 +01:00
df05e9b2ed GPencil: Change default z-depth offset to 0.150 2020-02-14 21:35:29 +01:00
03592482b0 Merge branch 'master' into greasepencil-object 2020-02-14 20:41:50 +01:00
2948d533c1 GPencil: Fix On/OFF buttons for VFX
As the VFX was using if the mode was render, and this mode was shared with the shading type, the Viewport ON/OFF button was not working as expected.

Now, the VFX use a is_viewport control and the is_render is not used.
2020-02-14 20:40:45 +01:00
aaaef87fd2 GPencil: Change Weight Paint to Blend values
Before, to substract weights it was necessary to press Ctrl key, but now the weight paint work equals to mesh weight paint blending weights and the Ctrl key is not used anymore.

This also allows to define the target weight easily.
2020-02-14 20:25:17 +01:00
427c114bc5 GPencil: Add rotation effect to Blur and change default value 2020-02-14 19:36:19 +01:00
61b64804a9 GPencil: Rename some params in Material panel 2020-02-14 18:46:12 +01:00
c44fe5f26c GPencil: New Rotation parameter for Blur VFX
Still pending (only var added)
2020-02-14 18:44:07 +01:00
efa3ba174b GPencil: Change Loop option for Onion Skin
Now is Show Start Frame
2020-02-14 18:35:58 +01:00
829533ea41 GPencil: Fix Duotone Colorize error in Panel
The props were using old BITONE name mode.
2020-02-14 18:16:23 +01:00
ca2f80fe5a GPencil: Convert Blur size to float and avoid unedeed passes if size is 0 2020-02-14 18:07:39 +01:00
e8563bb2c2 GPencil: Change Blur VFX panel and remove unused code 2020-02-14 17:42:19 +01:00
c6e56ce6b7 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/overlay/overlay_extra.c
2020-02-14 16:06:58 +01:00
c02e9ea823 Merge branch 'master' into greasepencil-object 2020-02-14 08:14:00 +01:00
a93111b23d GPencil: Cleanup: Remove TODOs 2020-02-13 21:08:56 +01:00
46d0e93b54 GPencil: Opti: Merge AntiAliasing pass with compositing pass
This avoid a useless memory write operation.
2020-02-13 21:08:56 +01:00
5de44e3bf6 GPencil: Avoid calculate diff matrix in every stroke 2020-02-13 20:05:53 +01:00
b21ab6c1b1 GPencil: Speedup Eraser evaluation using collision check
Now the eraser use the collision boundbox detection with the stroke before analyze stroke points.
2020-02-13 19:56:30 +01:00
5ce556d97e GPencil: Fix regresion in slow drawing with big files
Now is not needed to tag depsgraph datablock because the copy is very slow and creates lag.
2020-02-13 19:28:43 +01:00
ff49e4e0b9 GPencil: Cleanup old code of annotations 2020-02-13 18:46:16 +01:00
2babd14fd0 GPencil: Cleanup: Move codeblocks to improve code quality. 2020-02-13 17:48:23 +01:00
87c5e84233 Merge branch 'master' into greasepencil-object 2020-02-13 17:27:37 +01:00
fff864c878 GPencil: Back default Vertex Color for Brush to Green
Other areas of blender use White, but as GPencil default background is White, to have the default color as white is not logic.

We have decided to use the default green color used as icons color and in some add brushes.
2020-02-13 17:22:14 +01:00
7d377d2e9e GPencil: Fix compiler warnings 2020-02-13 17:04:25 +01:00
4f57d6db94 GPencil: Fix sbuffer stroke not overlapping with previous stroke 2020-02-13 15:53:38 +01:00
4d0d34b2d8 Merge branch 'master' into greasepencil-object 2020-02-13 15:44:26 +01:00
726ccf1d65 GPencil: More function names cleanup 2020-02-13 13:19:57 +01:00
0c4957c756 GPencil: Cleanup - Rename BKE_gpencil_eval_geometry
New name:  BKE_gpencil_frame_active_set
2020-02-13 13:11:29 +01:00
fca7638fd5 GPencil: More cleanup of old code 2020-02-13 13:01:03 +01:00
f423f334f9 GPencil: Cleanup initialization arrays code 2020-02-13 12:13:36 +01:00
7f4f933e6b GPencil: Rename gradient variables
gradient_f -> hardeness
gradient_s ->aspect_ratio
2020-02-13 11:16:30 +01:00
051e3e7978 GPencil: Remove old unused invert mask prop 2020-02-13 10:36:14 +01:00
0f6bcebba8 GPencil: Cleanup unused definition 2020-02-13 10:32:21 +01:00
05eb2eebd1 Merge branch 'master' into greasepencil-object 2020-02-13 10:09:25 +01:00
c874324c48 GPencil: Cleanup code 2020-02-13 10:08:38 +01:00
4e917eeeaf GPencil: New operator to recalculate geometry data
This operators is uded in special situations when migrate old files. As this is a specila situation, we are not going to add it to menus.
2020-02-13 09:56:31 +01:00
319e769ea3 GPencil: Support XRay mode in solid and fix occlusion in wireframe mode
This add basic alpha support in xray mode. However the wireframe mode
only support occlusion if xray is dissabled (i.e: there is no support for
partial occlusion).
2020-02-13 00:35:32 +01:00
e43fcee778 GPencil: Fix NaN result in divide blend mode 2020-02-13 00:28:36 +01:00
a6da286694 GPencil: Fix undefined behavior caused by stroke aspect commit 2020-02-12 22:21:04 +01:00
8c80cb8522 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
	source/blender/draw/engines/gpencil/gpencil_engine.c
	source/blender/draw/engines/gpencil/shaders/gpencil_edit_point_vert.glsl
	source/blender/draw/engines/gpencil/shaders/gpencil_zdepth_mix_frag.glsl
2020-02-12 19:00:28 +01:00
b3b236f0d3 GPencil: New Mask python API for add and remove 2020-02-12 18:58:38 +01:00
85a19a7b5c Cleanup: Move code 2020-02-12 17:57:43 +01:00
f0d05b382a GPencil: Fix alpha textured stroke buggy behavior
This was caused by the mask texture bind being lost. This is a quick and
dirty fix. Better solution would be to have a permanent bind.
2020-02-12 17:16:39 +01:00
1dc74b54d2 Merge branch 'master' into greasepencil-object 2020-02-12 17:08:08 +01:00
1218be4e3b GPencil: Fix breakage caused by aspect commit 2020-02-12 16:43:19 +01:00
8197354782 GPencil: Cleanup previous fix and use object as parameter 2020-02-12 16:29:00 +01:00
9147e57331 GPencil: Add Dot aspect support back 2020-02-12 16:19:01 +01:00
779f683ed0 GPencil: Fix Vertex Color one step behind
The vertex color was always one step behind because draw engine uses evaluated data, but paint operators don't update eval data before ending to speed up the painting process and to improve the pencil feeling.
2020-02-12 10:33:05 +01:00
01b748e614 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_engine.c
2020-02-12 10:05:51 +01:00
32d6fc5ba5 GPencil: Put Mask hide icon in RNA and not in python
Now the icon is associated to RNA property and don't need python code to handle it.
2020-02-12 10:03:56 +01:00
c55b48823d GPencil: Avoid animation in mask name 2020-02-12 09:58:14 +01:00
e424d92cf3 GPencil: Make mask icons animatable 2020-02-12 09:56:38 +01:00
95ff49daec GPencil: Rename gradient to hardeness
Also changed the title of aspect ratio to aspect only.
2020-02-12 09:44:28 +01:00
a580934b7a GPencil: Fix depth being written outside of masks boundaries
This fix requires yet another texture sample in the fragment shader.
Not so good for performance but from code simplicity perspective it will
do for now.
2020-02-12 03:04:14 +01:00
7c815db28d GPencil: Render: Fix crash when using region rendering
This was caused by RenderPass buffer being too small to create a fullscreen
texture.
2020-02-12 01:37:27 +01:00
2e33c6f645 GPencil: Fix hardfac = 1.0 bleeding outside of round corners 2020-02-12 01:10:48 +01:00
dec3cbc818 GPencil: Remove unpredicatble behavior when rendering without depth pass
We clear the reconstructed buffers if they have not be initialized.
2020-02-12 01:04:20 +01:00
44c6f14f1b Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2020-02-11 22:57:11 +01:00
c650ea9a13 GPencil: Add automatic sorting for Mask List
Now the masking is sorted in the same order of the layers. The order is recalculated when any layer is created, deleted or moved.
2020-02-11 19:37:47 +01:00
ad8ec8d828 GPencil: Move mask functions to BKE and fix delete layer
When delete a layer, all layers using this layer as mask must be updated.
2020-02-11 19:03:45 +01:00
956fafbc13 GPencil: Refactor: Fix completely hard stroke not being 100% hard
This was a problem with intensily lit gpencil objects.
2020-02-11 18:58:36 +01:00
19d04ce349 GPencil: Refactor: Remove the hardcoded sRGB final transform for viewport
Now viewport and render has the same look and colormanagement applied to it
2020-02-11 18:57:41 +01:00
6b24232474 GPencil: Refactor: Fix blend modes broken 2020-02-11 17:18:26 +01:00
d8c99ac34e GPencil: Refactor: Add per mask inversion capability
With this commit, masks can be inverted per layer. Inversion means the
mask becomes subtractive instead of additive. The base visibility does not
change depending on the first type (i.e: if ther is nothing in the mask
layer, nothing will be masked regardless of the mask type).
2020-02-11 17:12:39 +01:00
bc25c6af69 GPencil: Change Stroke Order tooltip 2020-02-11 16:58:00 +01:00
b47affbd75 GPencil: Reset Mask list index when remove first element 2020-02-11 16:47:25 +01:00
2b9ca08276 GPencil: Replace Add mask with popover menu
Also removed iinternal property used.
2020-02-11 16:43:45 +01:00
2741a165e2 Merge branch 'greasepencil-object' into greasepencil-refactor
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_engine.h
	source/blender/draw/engines/overlay/overlay_extra.c
	source/blender/draw/intern/draw_manager_exec.c
2020-02-11 15:40:15 +01:00
b69d051068 Merge branch 'master' into greasepencil-object 2020-02-11 15:29:39 +01:00
117fc08e51 GPencil: Change icons for Invert Mask: ON/OFF 2020-02-11 15:25:50 +01:00
8b6ecdb77f GPencil: Implement Stroke Hardeness
Still pending the aspect ratio
2020-02-11 15:18:19 +01:00
8f3e4c8625 GPencil: Fix typo error in struct name for write
This produced errors loading the mask list.
2020-02-11 11:58:20 +01:00
678ce13c72 GPencil: Fix merge layers operator to merge Mask list 2020-02-11 11:52:09 +01:00
5bdcbfc42b GPencil: Add new Hide and Invert icons to Masks 2020-02-11 11:24:56 +01:00
2954aa4c3b GPencil: Add limit control for number of masking layers 2020-02-11 10:53:04 +01:00
7763b8fe79 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-02-11 09:01:57 +01:00
9024f91ecc Merge branch 'master' into greasepencil-object 2020-02-11 09:01:21 +01:00
9ef18d8b36 GPencil: Refactor: Add implementation of new mask list system
This system makes it possible to have up to 256 layers in a GPencil Object
that can be used as masks. User can use more than 256 layers and use mask
on them but the masking one must be from one of the first 256.

This commit does not include optimizations.
2020-02-11 00:06:55 +01:00
377657b734 GPencil: Add header checkbox in Mask Panel 2020-02-10 19:11:53 +01:00
c6da0351bd GPencil: Don't hide blend mode for mask layers 2020-02-10 19:04:31 +01:00
11d7e5db6a GPencil: Change Mask panel layout 2020-02-10 18:54:39 +01:00
93516dd758 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-02-10 15:53:47 +01:00
f75445c17e GPencil: Fix compiler error after merge 2020-02-10 15:52:39 +01:00
9cb9a69dcd Merge branch 'greasepencil-object' into greasepencil-refactor 2020-02-10 15:46:04 +01:00
6a37a83fc0 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/gpencil.c
	source/blender/editors/sculpt_paint/paint_ops.c
2020-02-10 15:43:57 +01:00
ade92dc98d GPencil: Add option to add mask layer one by one
Now it uses a list of layer using a pure dynamic enum list.
2020-02-10 11:29:32 +01:00
9918b6c453 Merge branch 'greasepencil-object' into greasepencil-refactor
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2020-02-10 10:08:07 +01:00
a1b0c4ab9d Merge branch 'master' into greasepencil-object 2020-02-10 10:06:39 +01:00
b1059489b4 GPencil: Add invert mask option to Mask subpanel 2020-02-10 08:56:03 +01:00
6fc6a735d4 GPencil: Make Mask panel as Subpanel 2020-02-10 08:52:58 +01:00
57c8a07d30 GPencil: Don't add mask layers to mask list
This avoid  cyclic relations
2020-02-09 19:06:18 +01:00
12dfdd3dd0 GPencil: Back Mask Switch to 2 modes: ON/OFF 2020-02-09 18:16:44 +01:00
ddd5d35fba GPencil: New list of Masking Layers
This replaces the old unique layer for masking with a full list.
2020-02-09 18:16:27 +01:00
f7b794dc48 GPencil: Fix missing eyedropper options in toolbar 2020-02-08 20:23:38 +01:00
e14f886e6b Merge branch 'greasepencil-object' into greasepencil-refactor 2020-02-08 18:33:58 +01:00
5200ac1ef9 Merge branch 'master' into greasepencil-object 2020-02-08 18:33:19 +01:00
a9194f061e GPencil: Rename masking layer references when rename mask layer 2020-02-08 10:46:31 +01:00
94335f7989 GPencil: Use new BKE_gpencil_layer_named_get() instead of generic BLI 2020-02-08 10:32:25 +01:00
12777fb0f4 GPencil: Fix compiler warnings 2020-02-08 10:27:24 +01:00
ac7dfab0cb GPencil: Refactor: Fix display bug of strokes endpoints 2020-02-08 03:00:40 +01:00
10f2e39f48 GPencil: Refactor: New linked mask system
The new system is more flexible and a bit simpler from the code side.

Each layer has a mask layer slot. If filled with a correct layer name,
the mask layer will be rendered again in a separate buffer. This buffer
will then be used in the blend pass to modulate the opacity of the layer.

This approach is not 100% equivalent to the standard layering in most 2D
applications if using varying alpha on a mask applied to multiple layers.
However this technique does support any ordering arrangement of the masks.

The layers used as mask can now still render normaly.
2020-02-07 23:43:42 +01:00
4e2cb23bbd Merge branch 'greasepencil-object' into greasepencil-refactor 2020-02-07 19:10:15 +01:00
323808ca5a Merge branch 'master' into greasepencil-object 2020-02-07 19:09:33 +01:00
6fda1c8073 GPencil: Rename collision to boundbox
The initial use of the variables was collision, but now are used for more things, so it's better put a more general name.
2020-02-07 17:12:56 +01:00
4c492acba6 GPencil: Fix merge errors
Also, the modiifer reuse precalculated bounding box data.
2020-02-07 16:46:12 +01:00
c9ebd5fc16 Merge branch 'greasepencil-object' into greasepencil-refactor
Conflicts:
	source/blender/blenloader/intern/readfile.c
2020-02-07 16:38:21 +01:00
c0146170af Merge branch 'master' into greasepencil-object 2020-02-07 16:36:48 +01:00
2a84bfccdd GPencil: Remove unused drawing code for interpolate operator 2020-02-06 20:08:00 +01:00
ff7ccae322 GPencil: Remove old drawing from Interpolate operator
Now the drawing is done using the normal drawing engine and not the old drawing code.
2020-02-06 19:38:23 +01:00
327e90ad46 Cleanup: Interpolate operator
Replace loops and remove old unused code
2020-02-06 17:45:31 +01:00
b372ce3ec0 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-02-06 15:13:08 +01:00
3846212d1e Merge branch 'master' into greasepencil-object 2020-02-06 15:12:34 +01:00
8003bbe006 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-02-06 11:34:17 +01:00
330c0d8f4a GPencil: Add missing flag after merge
The vertex paint mode was not in master.
2020-02-06 11:32:56 +01:00
6711e59b32 Merge branch 'master' into greasepencil-object 2020-02-06 11:32:09 +01:00
742c5a0018 GPencil: Initial implementation of the layer mask relationship
Now, there is a new parameter to define the mask used by layer.

Still pending to remove old `use_mask` property in C and python (not removed yet to keep running the masking UI).
2020-02-05 19:46:21 +01:00
3883ffbefb Merge branch 'greasepencil-object' into greasepencil-refactor 2020-02-05 17:27:33 +01:00
e2d4e2403a Merge branch 'master' into greasepencil-object 2020-02-05 17:22:37 +01:00
300c64299c Merge branch 'greasepencil-object' into greasepencil-refactor
Conflicts:
	source/blender/blenloader/intern/readfile.c
	source/blender/blenloader/intern/versioning_280.c
2020-02-05 17:07:43 +01:00
21f7accd3b include last master changes
There was a problem in the last merge
2020-02-05 16:54:56 +01:00
7a88e2c158 GPencil: Fix function renaming after merge 2020-02-05 11:46:18 +01:00
23018417d5 Merge branch 'greasepencil-object' into greasepencil-refactor
Conflicts:
	source/blender/blenkernel/intern/gpencil_modifier.c
	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
	source/blender/draw/engines/gpencil/gpencil_engine.c
	source/blender/draw/engines/overlay/overlay_extra.c
	source/blender/editors/gpencil/gpencil_fill.c
	source/blender/editors/gpencil/gpencil_utils.c
	source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c
	source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
	source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c
	source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c
2020-02-05 11:42:35 +01:00
5f8ee2a36b GPencil: Fix renamed functions after merge 2020-02-05 11:39:55 +01:00
bc7a4d5bad Merge branch 'master' into greasepencil-object 2020-02-05 11:31:10 +01:00
76ef2f55d2 Cleanup: Remove unused function: give_node_material() 2020-02-05 11:25:50 +01:00
5314efc4cc T73589: Code Quality: Renaming on BKE_material.h
Old Name                             New Name
=========                            =========
init_def_material                    BKE_materials_init
BKE_material_gpencil_default_free    BKE_materials_exit
test_object_materials                BKE_object_materials_test
test_all_objects_materials           BKE_objects_materials_test_all
give_matarar                         BKE_object_material_array
give_totcolp                         BKE_object_material_num
give_current_material_p              BKE_object_material_get_p
give_current_material                BKE_object_material_get
assign_material                      BKE_object_material_assign
assign_matarar                       BKE_object_material_array_assign
give_matarar_id                      BKE_id_material_array
give_totcolp_id                      BKE_id_material_num
assign_material_id                   BKE_id_material_assign
clear_matcopybuf                     BKE_material_copybuf_clear
free_matcopybuf                      BKE_material_copybuf_free
copy_matcopybuf                      BKE_material_copybuf_copy
paste_matcopybuf                     BKE_material_copybuf_paste
BKE_material_init_gpencil_settings   BKE_gpencil_material_attr_init
BKE_material_add_gpencil             BKE_gpencil_material_add
BKE_material_gpencil_get             BKE_gpencil_material
BKE_material_gpencil_default_get     BKE_gpencil_material_default
BKE_material_gpencil_settings_get    BKE_gpencil_material_settings
2020-02-05 11:23:58 +01:00
6c815ebc5b Merge branch 'greasepencil-object' into greasepencil-refactor 2020-02-05 11:11:26 +01:00
c0e989d3e5 Merge branch 'master' into greasepencil-object 2020-02-05 11:10:54 +01:00
d32e08aecf GPencil: New function to create strokes 2020-02-04 17:36:47 +01:00
1d81a59d7a GPencil: Hide rotation parameter for Radial gradients 2020-02-04 15:47:29 +01:00
697ec7b55e GPencil: Patch old gradient materials and remove old variables 2020-02-04 15:43:56 +01:00
9323d063b4 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-02-04 12:41:30 +01:00
b1748fbc6d Merge branch 'master' into greasepencil-object 2020-02-04 12:41:01 +01:00
adcee4f751 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-02-04 09:10:04 +01:00
d09002adc4 Merge branch 'master' into greasepencil-object 2020-02-04 09:09:30 +01:00
fdff148b6b GPencil: Fix variable out of scope 2020-02-04 09:08:35 +01:00
7ce7bf0856 GPencil: Hide other frames in multiedit if Overlay main switch is OFF 2020-02-03 19:16:18 +01:00
602e9e4732 GPencil: Recalc geometry only for deform sculpt 2020-02-03 18:35:02 +01:00
d58e2c36d9 GPencil: Remove double calculation of geometry in Push sculpt brush 2020-02-03 18:16:17 +01:00
ed29fca3c0 GPencil: Fix crash when remove points in cyclic strokes
The geometry must be calculated for new joined stroke, not for parts to join.
2020-02-03 16:58:20 +01:00
273068f6da GPencil: Cleanup duplicated context function call 2020-02-03 10:37:13 +01:00
694107bd49 GPencil: Cleanup 2D code in sculpt
This operator can be used in 3D space only.
2020-02-03 10:19:51 +01:00
c65d96d56b Merge branch 'greasepencil-object' into greasepencil-refactor 2020-02-03 09:10:59 +01:00
ad4b41063e Merge branch 'master' into greasepencil-object 2020-02-03 09:10:09 +01:00
71fc909601 GPencil: Optimize triangulation calc in sculpt 2020-02-03 09:06:08 +01:00
56a5ffbf08 GPencil: Optimize evaluated frame copy 2020-02-02 23:36:41 +01:00
afab7bca17 GPencil: Optimize update pointer origin
The Link now is calculated using index not using BLI function.

This speedup a lot the function.
2020-02-02 23:31:02 +01:00
18a8306a19 GPencil: Fix reset all brushes in other modes
The operator was working with Draw brushes, but not with Sculp/Weight or Vertex Paint.
2020-02-02 22:50:04 +01:00
656fab5ec0 GPencil: Simplify brush initialization code 2020-02-02 22:25:06 +01:00
2d00121cca Merge branch 'greasepencil-object' into greasepencil-refactor 2020-02-02 22:22:11 +01:00
1d0a157614 GPencil: Fix tablet errors after merge 2020-02-02 22:06:48 +01:00
762e92e8d8 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-02-02 16:46:39 +01:00
ae05c503ee Merge branch 'master' into greasepencil-object 2020-02-02 16:45:44 +01:00
fa405209e6 GPencil: Improve collision rectangle size
The problem was the rectangle for mouse it was using the internal rectangle, but must be the external rectangle, or the corners will not be detected.

Also some code cleanup.
2020-02-02 16:43:46 +01:00
25de271008 GPencil: Recalc triangulation for active frame and delay others 2020-02-02 16:24:34 +01:00
59f37adac3 GPencil: Use bounding box collision instead of radius 2020-02-02 10:37:28 +01:00
237b77954a GPencil: Add collision checking for Sculpt
Instead to check all points, first a general stroke checking is done in order to avoid reading thousands of points.
2020-02-01 20:14:33 +01:00
9449808a93 GPencil: Small loop optimization 2020-02-01 18:09:59 +01:00
ea544f378a GPencil: Sculpt optimization
Reduce the calculation of filling geometry and matrix repetitive.
2020-02-01 17:46:40 +01:00
de487a8b01 GPencil: Cleanup unused function 2020-02-01 15:59:10 +01:00
166bacebc9 GPencil: In multiframe show only lines for non active frame
When use multiframe, it's important to see in full color only the active frame, and the other frames just with a line if the option is enabled.
2020-02-01 12:44:20 +01:00
6e862487a4 GPencil: Make wider the advanced brush topbar menu
With the default width, the texts are not fully visible.
2020-02-01 11:35:14 +01:00
ad52ba8999 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-02-01 08:56:28 +01:00
9c82e3fd69 Merge branch 'master' into greasepencil-object 2020-02-01 08:54:49 +01:00
80290684a3 GPencil: Cleanup unused function 2020-01-31 19:18:37 +01:00
8da7317058 GPencil: Fix problem drawing in instances with modifiers
There is a problem of performance if a instance uses modifiers because need a full copy. Need more investigation to find a faster method to duplicate the full datablock.
2020-01-31 18:14:57 +01:00
d27e852cb7 GPencil: Moves buffer drawing data to eval data
Instead to put the sbuffer data in the original datablock, now is copied to evaluated data, but without tagging all datablock that makes things very slow in fast drawing.

This changes removes the hacks to use the original datablock for buffers in the drawing engine.

Note: still there is a problem when a datablock is used several times with modifiers.
2020-01-31 17:02:47 +01:00
42d3a160bd GPencil: Fix crash when mask layer is empty
When the layer is empty, the mask framebuffer must be created.
2020-01-30 16:59:11 +01:00
395987d223 GPencil: Fix parameter missing after merge 2020-01-30 10:45:18 +01:00
938d0b5e2f Merge branch 'greasepencil-object' into greasepencil-refactor
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
2020-01-30 10:33:31 +01:00
7a8e57f03d Merge branch 'master' into greasepencil-object 2020-01-30 10:26:54 +01:00
e66cc7d8b7 GPencil: Update child transform when parent is transformed
Now, if you move the parent object, the child moves too.
2020-01-29 13:17:57 +01:00
7459722473 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-29 11:20:57 +01:00
223b6398ef Merge branch 'master' into greasepencil-object 2020-01-29 11:20:28 +01:00
d0b8b49b44 GPencil: Use stack order for build modifiers
With the new evaluation, is possible to evaluate the modifiers in stack order.

This fix T66744
2020-01-28 22:59:52 +01:00
fb38f0daae GPencil: Basic parenting working
Still looks one frame late.
2020-01-28 22:40:26 +01:00
aad7fc9557 GPencil: Include original reference to layer in runtime data 2020-01-28 22:40:20 +01:00
3105dde8b3 GPencil: Move parent matrix function to BKE module
Also, the function has been renamed to use a better naming.
2020-01-28 22:40:13 +01:00
46280f5997 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-28 10:02:05 +01:00
ba9f26d4af Merge branch 'master' into greasepencil-object 2020-01-28 10:01:37 +01:00
8a43814e03 Merge branch 'greasepencil-object' into greasepencil-refactor
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_engine.c
2020-01-27 11:35:28 +01:00
5518ed8e23 Merge branch 'master' into greasepencil-object 2020-01-27 11:34:32 +01:00
a76c527072 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-26 17:54:20 +01:00
135eada2db Merge branch 'master' into greasepencil-object 2020-01-26 17:53:48 +01:00
8d6e1a864b Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-25 13:14:08 +01:00
ff93ed2801 Merge branch 'master' into greasepencil-object 2020-01-25 13:13:39 +01:00
db916edb05 GPencil: New parameter to add stroke at head
This makes the BKE_gpencil_stroke_add function more flexible.
2020-01-25 13:09:35 +01:00
b5f16581c0 GPencil: Cleanup - Rename BKE function 2020-01-25 12:57:33 +01:00
e9da262467 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-24 19:14:50 +01:00
bdd605b17d Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/makesdna/DNA_brush_types.h
2020-01-24 19:13:37 +01:00
602822a846 GPencil: Cleanup some loops 2020-01-24 16:24:35 +01:00
277a51dfb6 GPencil: Cleanup - Replace more loops with LISTBASE_FOREACH 2020-01-24 10:36:12 +01:00
4c8cd0b512 GPencil: Cleanup - Replace more loops with LISTBASE_FOREACH 2020-01-24 10:29:27 +01:00
0aa0d9b346 GPencil: Cleanup - Replace frame loops by Macro LISTBASE_FOREACH 2020-01-24 10:15:43 +01:00
e313dd69c6 GPencil: Cleanup - Replace layer loops by Macro LISTBASE_FOREACH 2020-01-24 10:10:02 +01:00
399e8223ff Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-24 09:44:44 +01:00
aa8a950689 Merge branch 'master' into greasepencil-object 2020-01-24 09:44:21 +01:00
14db677520 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-24 08:24:03 +01:00
1923736154 Merge branch 'master' into greasepencil-object 2020-01-24 08:23:20 +01:00
2e7764b8f0 GPencil: Refactor: Make Stroke as dot (lonely vert stroke) use obj orient.
This is to be more consistent with the UV behavior of a full stroke.
2020-01-23 22:34:27 +01:00
6e2710f479 GPencil: Refactor: Fix strokes with only 1 vertex 2020-01-23 22:25:30 +01:00
b41d22ea0d GPencil: Vertex Color must be enabled always in Render 2020-01-23 17:03:35 +01:00
cfe8d5f255 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-23 16:58:21 +01:00
9eb6e12c93 Merge branch 'master' into greasepencil-object 2020-01-23 16:56:59 +01:00
5da5acee38 GPencil: Recalc UV along the stroke while drawing
The data was not calculated for the buffer stroke and the texture was not right.
2020-01-23 11:24:15 +01:00
cd90711f07 GPencil: Fix onion skin in render
This commit fix two problems:

1) The onion skin was visible in render if the layer had the onion skin to ON, but the general onion swith was off. This made different viewport and render.

2) The option to render onion skin was not supported. By default, the onion skin is hidden in render, but there is an option to enable in render output.
2020-01-23 11:07:02 +01:00
8e7161c90b Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-23 09:18:54 +01:00
b642d36bc6 Merge branch 'master' into greasepencil-object 2020-01-23 09:18:26 +01:00
b72485e579 GPencil: Refactor: Fix missing material offset 2020-01-22 22:19:20 +01:00
ebbb7bde83 GPencil: Cleanup - Remove unused function 2020-01-22 19:49:25 +01:00
3956a51b93 GPencil: Rename BKE function to use stroke prefix 2020-01-22 18:24:09 +01:00
78aea2873b Revert "GPencil: Cleanup - Add parentesis"
This reverts commit d5deb59d3b.
2020-01-22 17:11:17 +01:00
8326973ac2 GPencil: Enable Lights in Render mode
The lights were not enabled in render
2020-01-22 17:10:01 +01:00
d5deb59d3b GPencil: Cleanup - Add parentesis 2020-01-22 16:47:55 +01:00
a3cc14c6d5 GPencil: Change Title for Vertex Color parameters 2020-01-22 16:20:27 +01:00
5fd3d0a797 GPencil: Do not use locked layers in Sculpt 2020-01-22 16:07:29 +01:00
62de0faa70 GPencil: Fix Material preview render
This bug was introduced with fade objects
2020-01-22 11:06:32 +01:00
9acebbb0f5 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-22 10:33:37 +01:00
8f3153285e Merge branch 'master' into greasepencil-object 2020-01-22 10:33:06 +01:00
6f4a24bb20 GPencil: Cleanup - Add BKE_prefix to kernel function 2020-01-22 10:31:31 +01:00
8171e086e7 GPencil: Fix Vertex and Weight Paint did not use Lock Layer 2020-01-22 10:28:01 +01:00
7f8e1e1669 GPencil: Fix tablet code error after merge 2020-01-21 19:30:01 +01:00
bada831b1d Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-21 19:01:25 +01:00
39e83ff843 Merge branch 'master' into greasepencil-object 2020-01-21 19:00:49 +01:00
9800890886 GPencil. Tag datablock when In Front property is changed 2020-01-21 18:06:05 +01:00
f988869434 GPencil: Add support for Object In Front option
Still need a small change in RNA to tag datablock when property is changed.
2020-01-21 18:06:00 +01:00
5203d0ca48 GPencil: Implement Fade 3D objects 2020-01-21 16:03:30 +01:00
0bd3484d7d GPencil: Implement grease pencil object fade 2020-01-21 15:39:02 +01:00
144f9e588e GPencil: Rename gpencil_paper to fade_objects
The name was not clear now because is not a "paper" in front of the 3d meshes as it was done in old system.
2020-01-21 15:38:55 +01:00
40ac43ba2b Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-21 10:51:29 +01:00
3fd72a59de Merge branch 'master' into greasepencil-object 2020-01-21 10:50:45 +01:00
762bf9f328 GPencil: Cleanup old debug line 2020-01-21 09:23:24 +01:00
43ce8e6308 GPencil: Use BKE function to duplicate stroke 2020-01-21 09:20:48 +01:00
29c37219bf GPencil: Add new parameter to BKE_gpencil_stroke_duplicate to copy points 2020-01-21 09:08:26 +01:00
abe51900fa GPencil: Fix missing triangles data duplication
Now this data must be copied all times when a stroke is duplicated.
2020-01-20 19:32:11 +01:00
689c042b2d GPencil: Implement Fade Layers 2020-01-20 17:49:02 +01:00
524fdc23f2 GPencil: Cleanup unused variable for old derived_frames array
The variable layer_index is not required now.
2020-01-20 16:51:58 +01:00
2df526651a Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-20 16:21:12 +01:00
edf310d324 Merge branch 'master' into greasepencil-object 2020-01-20 16:19:54 +01:00
8061f2a4d1 GPencil: Reduce Fill opacity while drawing
This is used when fill strokes to be able to see the lines below and make a more precise filling. This opacity will be reset in the final fill and it's only while drawing.
2020-01-20 15:47:12 +01:00
5babbdfc54 GPencil: Cleanup comment 2020-01-20 15:44:12 +01:00
44200957dd GPencil: Cleanup old runtime data not used 2020-01-20 15:43:29 +01:00
8c0dd76757 GPencil: Move duplicated sbuffer vertex color set to function 2020-01-20 15:35:28 +01:00
4109094362 GPencil: Fix missing stroke color while drawing when use Vertex Color 2020-01-20 13:46:38 +01:00
1593a3fda6 GPencil: Fix Fill color when using Vertex Color 2020-01-20 13:27:04 +01:00
366663e47b GPencil: Convert Vertex Color to Linear from Palette or Brush color
Grease pencil works in linear, but the brushes and palettes no.
2020-01-20 13:16:28 +01:00
134f8e19f5 GPencil: Fix Fill opacity factor in Fill tool 2020-01-20 11:55:54 +01:00
9cccf87cbb GPencil: Fix Fill missing while drawing and new draw strokes 2020-01-20 10:33:21 +01:00
bc889e5635 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-19 17:21:46 +01:00
7ed83fce96 Merge branch 'master' into greasepencil-object 2020-01-19 17:21:13 +01:00
78783b3e16 GPencil: Test modifiers Tint and Hue/Saturation to use material if the Vertex color is not active. 2020-01-19 17:20:24 +01:00
46ccd9efac GPencil: Fix error in convert to Vertex Color
It was not checking if the alpha of tha material was > 0 to detect if Fill and/or Stroke material.
2020-01-19 17:19:35 +01:00
cbce9a0c83 GPencil: Fix Color properties using sRGB
The colors were wrong because now all is Linear.
2020-01-19 16:46:35 +01:00
dbf4ddbe16 GPencil: Move opacity factor to stroke from runtime
If the modifier is applied, need to be in the stroke.

Note: Maybe we need to active this value in some sculpt brush to define the opacity of the Fill, because when you apply the modiifer, you can only replace the value using the modifier again. Other solution would be a reset opacity operator.
2020-01-19 16:35:54 +01:00
52c6857486 GPencil: Fix Opacity modifier for Fill
Now the modifier is able to apply opacity to the Fill area as it was in previous versions.
2020-01-19 16:21:44 +01:00
b847861b6c GPencil: Refactor: Reuse GPENCIL_MaterialPool across multiple objects
This minimize the number of UBO we create and the number of UBO switching
we have to do to render each objects.
2020-01-19 02:12:59 +01:00
0d0bfd3c36 GPencil: Fix slow calculation in Edit transformations
Now the triangulation is only calculated once by stroke, not for each point.
2020-01-18 16:31:47 +01:00
db18c87785 GPencil: Fix color modifiers
With new draw engine implementation the old system did not work.
2020-01-18 15:55:03 +01:00
c64c51ee4d Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-18 11:54:03 +01:00
b3c18f037f Merge branch 'master' into greasepencil-object 2020-01-18 11:52:58 +01:00
4d939ff47a GPencil: New evaluation of derived frames and Filling calculation
As grease pencil was created before depgraph, it was using a custom solution to create derived data to apply modifiers on top. With the new refactor of the drawing engine, we need to have the runtime data at datablock (bGPdata) level to share between instances, but also we neeed to have separated eval data because different objects can use different modifiers (equals to actual mesh_eval logic). The old derived frame array solution is not valid anymore.

The initial idea was to make a full copy of the datablock in a separated eval copy, but testing this solution, it was very slow, so now, the full copy is only done once, and later, only the active frame data is updated (see note below).

In a future development, the ideal solution would calculate all frames at the same time and only copy again if something changes, but now this change is out of scope. I have been performing tests and with this "only active frame" copy,

Also, this solution simplifies several areas of the code, because now it's not necessary to deal with derived frame array, and just use datablock as is.

This update also includes the following:

* How the filling information is managed. Before, the triangulation data was created only during drawing process, and it was not saved. With the new engine, this information must be available always, so instead to calculate in drawing time, now the information is saved and generated or updated each time the stroke is modified. To have the filling information calculated improves FPS and simplify drawing and modifier evaluation code.

* Remove unused parameters related to old Filling calculation logic. This also simplifies the UI panels.

* Added simplify modifier options. This was removed, but after last changes it's good to have as before.

Differential Revision: https://developer.blender.org/D6597
2020-01-18 11:51:14 +01:00
cb089c25e2 GPencil: Refactor: Speedup: Add drawcall merging of consecutive strokes
This reduces driver & DRW overhead when a lot of strokes are drawn with
the same material pool.
2020-01-18 00:42:43 +01:00
ffe04df25e Merge branch 'greasepencil-refactor' into temp-gpencil-eval 2020-01-17 22:14:47 +01:00
8b7985e1e4 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-17 22:14:12 +01:00
2d791535bb Merge branch 'master' into greasepencil-object 2020-01-17 22:13:25 +01:00
f5ebc81cd9 Cleanup: Fix comment 2020-01-17 17:43:47 +01:00
018c3826de Merge branch 'greasepencil-refactor' into temp-gpencil-eval 2020-01-17 16:38:52 +01:00
4a1df929be GPencil: Fix subversion patch number 2020-01-17 16:38:12 +01:00
b2303f1677 GPencil: Cleanup - Make function static 2020-01-17 16:34:03 +01:00
8ec723da8c GPencil: Use existing eval copy for single users 2020-01-17 16:32:26 +01:00
36d8042c94 Merge branch 'greasepencil-refactor' into temp-gpencil-eval 2020-01-17 14:44:18 +01:00
455f972e69 GPencil: Fix previously selected strokes shows selected after lock their layer 2020-01-17 14:43:20 +01:00
512a077166 GPencil: Refactor: Fix assert caused by framebuffer usage optimisation 2020-01-17 13:56:17 +01:00
022e37a443 GPencil: Optimize when use only one user 2020-01-17 10:40:56 +01:00
56d63d604c Merge branch 'greasepencil-refactor' into temp-gpencil-eval 2020-01-17 10:10:57 +01:00
79ade9203d GPencil: Fix versioning code to check version 2020-01-17 10:10:19 +01:00
f4a62215cb Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-17 10:06:42 +01:00
efce497f6b Merge branch 'master' into greasepencil-object 2020-01-17 10:05:39 +01:00
accf488a35 GPencil: Fix segment fault in triangulation
If the number of points is < 2, clear the triangles data.
2020-01-17 10:04:42 +01:00
630472a615 GPencil: Move triangulation to modifiers and remove force fill recalc 2020-01-17 08:55:33 +01:00
8b02f761d9 GPencil: Refactor: Allocate GPU framebuffers only if necessary
Also use signed format only if needed.

Note that you cannot see subtractive, overlay and divide blend modes in
the viewport because of the srgb hack AND the current viewport framebuffer
format.
2020-01-17 01:11:48 +01:00
4ce820c819 Cleanup: Rename BKE_gpencil_calc_stroke_uv function to BKE_gpencil_stroke_uv_update 2020-01-16 22:56:45 +01:00
467f65ca20 Calculate Filling data when stroke is modified
Instead to calculate the geometry data in runtime, now this data is calculated when the stroke is created or modified and saved.
2020-01-16 22:54:58 +01:00
7656611924 Revert "Tag any stroke using the material property"
This reverts commit 07c2a935cf.
2020-01-16 18:41:07 +01:00
e61e177e4c Remove gp_style parameter 2020-01-16 18:40:59 +01:00
07c2a935cf Tag any stroke using the material property
This is required to calculate triangulation if the material is changed from NO Fill to Fill
2020-01-16 16:29:47 +01:00
ca0dd753d3 Fixes after first code review 2020-01-16 15:49:19 +01:00
a26735ac91 Create duplication of material array for eval datablock
If this copy is not done, when the datablock is cleared, the first datablock that use the material array, destroy the array, and in the second time the pointer is used, it's invalid.

Now, each datablock, uses its own material array.
2020-01-16 13:19:40 +01:00
bd72aa8984 Cleanup: More use of LISTBASE_FOREACH 2020-01-16 10:32:03 +01:00
3edadc47bf Cleanup: Use LISTBASE_FOREACH 2020-01-16 10:24:43 +01:00
e9e9934d1b Fix bug introduced in previous commit checking number of users
If the eval is not used for 1 user, the modifier is added again and again.

To avoid this eval, it would be required a flag to check if the modifier was applied before, but this need more work and we will do in the future.
2020-01-16 10:09:00 +01:00
648b77bf4b Merge branch 'greasepencil-refactor' into temp-gpencil-eval 2020-01-16 08:41:54 +01:00
329205ef78 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-16 08:41:07 +01:00
57bb8b0c8a Merge branch 'master' into greasepencil-object 2020-01-16 08:40:28 +01:00
5648e8c738 GPencil: Show overlap option for Texture materials 2020-01-16 08:39:26 +01:00
6ef909bdf9 Do not create eval data if users is 1
If only one user, the default eval data is used and don't need a new copy
2020-01-16 08:35:15 +01:00
9061736e29 Merge branch 'greasepencil-refactor' into temp-gpencil-eval 2020-01-15 19:14:51 +01:00
5192d3ca04 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-15 19:13:51 +01:00
71386813de Merge branch 'master' into greasepencil-object 2020-01-15 19:13:13 +01:00
58328607e7 Fix Sculpt to use Eval data 2020-01-15 19:12:27 +01:00
82d2d770c1 Cleanup: Remove ToDo comments 2020-01-15 19:08:45 +01:00
85279c6883 Fix Weight Paint to use Eval data 2020-01-15 19:08:11 +01:00
2fd4893534 Fix Vertex Paint to use Eval data 2020-01-15 18:13:39 +01:00
1fa7b7c011 Save reference to original frame 2020-01-15 18:13:23 +01:00
3363a7f616 Copy relevant variables to eval datablock
Instead to copy full datablock (very slow), just copy the active frame, but also the variables related to GPD and GPL.
2020-01-15 17:23:59 +01:00
c3a01757f8 Copy full datablock to Eval
Need to copy all, or all tags are missing
2020-01-15 16:23:03 +01:00
7ff385d854 Revert "GPencil: Fix missing edit points with modifiers"
This reverts commit 6c9f72c1b2.
2020-01-15 16:05:05 +01:00
6c9f72c1b2 GPencil: Fix missing edit points with modifiers
The flag was updated in original datablock, but not in eval copy.
2020-01-15 11:51:36 +01:00
3e858b463b Merge branch 'greasepencil-refactor' into temp-gpencil-eval 2020-01-15 11:11:11 +01:00
749c51181a GPencil: Set default vertex color to White 2020-01-15 11:09:57 +01:00
5838336801 Cleanup compiler warnings 2020-01-15 10:41:29 +01:00
b864fd7c66 Merge branch 'greasepencil-refactor' into temp-gpencil-eval 2020-01-15 10:22:01 +01:00
2bcf9a7d22 GPencil: Fix merge error 2020-01-15 10:20:37 +01:00
ee91b4f9f8 Cleanup: Reformat fill functions 2020-01-15 10:10:15 +01:00
24c595c0d2 Merge branch 'greasepencil-refactor' into temp-gpencil-eval 2020-01-15 08:52:12 +01:00
a008dba54c GPencil: Fix merge error 2020-01-15 08:51:39 +01:00
3e5475d12e Merge branch 'greasepencil-object' into greasepencil-refactor
Conflicts:
	source/blender/draw/engines/overlay/shaders/outline_prepass_frag.glsl
	source/blender/draw/intern/draw_manager_exec.c
	source/blender/editors/gpencil/drawgpencil.c
2020-01-15 08:48:43 +01:00
670d96f737 GPencil: Cleanup unused code 2020-01-15 08:40:23 +01:00
6a0ab6dbce Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2020-01-15 08:36:55 +01:00
927bcdac9a Cleanup: reduce if levels 2020-01-14 19:58:37 +01:00
d0865adc57 Fix missing modifiers when apply transform 2020-01-14 19:37:47 +01:00
75d0559b04 Cleanup: Remove unused code and old comments 2020-01-14 18:11:59 +01:00
2d943d616f Back again Simplify Modifiers option 2020-01-14 17:49:25 +01:00
bf488402df Fix error in previous commit
The do_modifiers var was wrong
2020-01-14 17:18:02 +01:00
e0bb1e8c07 Cleanup code 2020-01-14 17:05:42 +01:00
903242a817 Fix more problems with selection 2020-01-14 16:42:52 +01:00
680e3c3031 Use evaluated data for selecction 2020-01-14 16:05:51 +01:00
ee09d2c127 Keep orig pointer references updated 2020-01-14 13:51:07 +01:00
edbebeb44f Move filling data and orig pointers evaluation to Depsgraph 2020-01-14 13:30:41 +01:00
e621c426e6 Merge branch 'greasepencil-refactor' into temp-gpencil-eval 2020-01-14 12:00:41 +01:00
4aa4509000 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-14 12:00:01 +01:00
7e7f9dde91 Merge branch 'master' into greasepencil-object 2020-01-14 11:59:14 +01:00
1febe8caef Use index to get evaluated frame 2020-01-14 11:56:03 +01:00
1a229f2e60 Split triangulation calculation 2020-01-14 11:33:14 +01:00
5493a30520 Cleanup: clarify comments 2020-01-14 11:08:36 +01:00
85779228d0 Cleanup: Split assign pointers 2020-01-14 11:02:04 +01:00
356fe859f2 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-13 18:10:35 +01:00
1727ffafee Merge branch 'master' into greasepencil-object 2020-01-13 18:09:59 +01:00
272370ae75 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-13 11:46:25 +01:00
44278f89a0 Merge branch 'master' into greasepencil-object 2020-01-13 11:45:44 +01:00
619257c045 More changes to make eval 2020-01-13 10:20:52 +01:00
661f30df51 Minimum process working but very slow 2020-01-12 13:08:07 +01:00
9d7b023808 GPencil: Test to move cache to datablock
This move the cache and assign orig pointers to Stroke and Points
2020-01-12 13:08:07 +01:00
a8b339ed0a GPencil: Fix missing Vertex Top options in texture material 2020-01-12 10:04:22 +01:00
003bb94501 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-12 09:57:26 +01:00
54c83ba487 Merge branch 'master' into greasepencil-object 2020-01-12 09:56:21 +01:00
50da5bf2cb GPencil: Refactor: Remove per layer random color jitter in wireframe
This is barely noticeable and makes it more confusing than anything in the
code. It's also faster and follow solid mode more closely.
2020-01-12 00:40:02 +01:00
c6ac861c06 GPencil: Refactor: Fix gradient behavior in texture color mode 2020-01-11 20:28:03 +01:00
1da03b2e80 GPencil: Refactor: Make Texture UV transform behave like normal 3D ones
Meaning we apply location then rotation then scale. This makes positioning
using the parameters easier.

Also since the gradients now use the same UV space, we can reuse the same
properties for the transform.
2020-01-11 20:27:31 +01:00
1d25838eb4 GPencil: Fix vertex color draw tool color blending
This removes the darkened color artifacts due to incorect alpha blending.
2020-01-11 19:37:03 +01:00
2e609a4582 GPencil: Refactor: Add fill vertex color suppport
This is a waste of GPU memory tho. It is duplicated for each gp points.

A better approach would be to store a per stroke data that we could fetch
using a stroke id.
2020-01-11 19:36:03 +01:00
0ce14a8e58 GPencil: Rename mix_color to vert_color
Also renamed mix_color_fill to vert_color_fill
2020-01-11 17:19:50 +01:00
00feefba10 GPencil: Refactor: Enable Vertex color mode in vertex paint
This is to follow the same behavior as meshes.
2020-01-11 16:41:16 +01:00
1efd6f0bd2 GPencil: Refactor: Fix is_render flag
This should fix VFX toggling for render mode only.
2020-01-11 16:12:57 +01:00
710601b5d0 GPencil: Refactor: Support solid mode color modes
This should be a 1:1 feature parity with what the workbench do with meshes
objects.
2020-01-11 16:12:57 +01:00
ec9b7b56d8 GPencil: Cleanup more unused code 2020-01-10 22:10:37 +01:00
e55dc7667a GPencil: Remove unused variable 2020-01-10 19:35:17 +01:00
bc774caaac GPencil: Refactor: Make Lighting effect only happen in lookdev & render mode
This makes the lighting behavior much more consistent with the other objects.
2020-01-10 18:47:56 +01:00
988c45924a Cleanup: GPencil: Remove unecessary comment 2020-01-10 17:11:22 +01:00
bd0809da61 GPencil: Refactor: Fix depth sorting with workbench render 2020-01-10 17:11:06 +01:00
086a45f0b7 Cleanup: GPencil: Move shader static variable to gpencil_shader.c 2020-01-10 16:56:50 +01:00
a1c0d06404 GPencil: Refactor: Fix surface projected stroke not shown during stroke 2020-01-10 16:56:50 +01:00
2ccb645095 GPencil: Replace tooltip 2020-01-10 16:53:24 +01:00
37136803ce GPencil: Split overlay options in columns 2020-01-10 16:35:43 +01:00
2ae1c97ab3 GPencil: Remove Vertex Paint Opacity for Edi & Sculpt 2020-01-10 16:08:32 +01:00
4e957d406f GPencil: Remove duplicated code 2020-01-10 16:05:34 +01:00
5d6eb25858 GPencil: Refactor: Enable gpencil engine if xray is not used
Thus making the gpencil opaque. However, partial transparency is still
unsuported.
2020-01-10 14:00:35 +01:00
80109a69ea GPencil: Refactor: Remove 3D stroke offset
This is conflicting with overlays and makes objects poke through each
others. As the 3D mode is intended to 3D drawing, it should have correct
3D positionning. This will however create a lot of zfighting artifacts on
overlapping strokes.
2020-01-10 13:59:35 +01:00
4f2c19b423 GPencil: Refactor: Fix crash when drawing on blank gpobject 2020-01-10 13:35:41 +01:00
934b719d0b GPencil: Refactor: Fix degenerate line in edit mode 2020-01-10 13:14:36 +01:00
5363370299 GPencil: Remove patch old files to Lights ON at Object level
This option breaks the colors, so only must be enabled for new objects.
2020-01-10 11:18:59 +01:00
c2a1883e63 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-10 11:03:05 +01:00
2ec4438fbf Merge branch 'master' into greasepencil-object 2020-01-10 11:02:24 +01:00
1b62c4cf68 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-10 09:04:05 +01:00
926fc0f04f Merge branch 'master' into greasepencil-object 2020-01-10 09:03:33 +01:00
938a26be8f Gpencil: Refactor: Support per layer random color in wireframe overlay 2020-01-09 22:09:56 +01:00
de4c23384f GPencil: Refactor: Add support for GPencil wireframes 2020-01-09 22:09:56 +01:00
2942e7eb03 GPencil: Refactor: Don't draw Gpencil objects if drawtype is not solid 2020-01-09 22:09:56 +01:00
b33c61a4af GPencil: Refactor: Add gpencil case to BKE_object_is_in_editmode 2020-01-09 22:09:56 +01:00
40828b96fc GPencil: Fix typo errors 2020-01-09 19:20:19 +01:00
7654045981 GPencil: Move Show Material Name to Overlay
Before there was a trick to use the object name option, but now it uses a separated option.
2020-01-09 19:16:05 +01:00
7f7de6051a GPencil: Hide Guide tools for other modes
Still pending hide the guide if using a tool not related.
2020-01-09 18:10:52 +01:00
ae529faa87 GPencil: Refactor: Add back guides and control points overlays
This use a special shader to draw points using uniforms. This is to avoid
creating a batch for each frame.

This is ok since the number of points is really low.
2020-01-09 17:52:58 +01:00
a5cd3cb99f GPencil: Rename GP_STYLE_* to GP_MATERIAL_*
This makes code easy to understand.
2020-01-09 17:28:06 +01:00
4f5a8c40a7 Cleanup: GPencil: Reuse iterator for color name 2020-01-09 17:09:23 +01:00
1f26f4f3c2 GPencil: More cleanup of old code 2020-01-09 16:38:43 +01:00
99b94d5485 GPencil: Patch old files to use lights to ON
Also, when add a new OB_GPENCIL, this option is enabled by default.
2020-01-09 16:32:51 +01:00
8677b82357 GPencil: Refactor: Fix green clear color and use srgb only in viewport 2020-01-09 16:17:06 +01:00
a3677b4536 Cleanup: GPencil: Remove GCC warnings 2020-01-09 15:58:13 +01:00
c1fbef93dc Cleanup: GPencil: Remove unused cache function
Thoses were old duplicates
2020-01-09 15:51:56 +01:00
42ad3282c5 GPencil: Refactor: Rewrite the render pipeline
This was really outdated. We do everything on the GPU now.
2020-01-09 15:51:56 +01:00
07724a7c73 Cleanup: GPencil: Remove GCC warnings 2020-01-09 15:51:56 +01:00
2672ec429f Cleanup: GPencil: Make code more readable 2020-01-09 15:51:56 +01:00
5196533f91 GPencil: Refactor: Make sbuffer batches managment more robust
This fix the slowdown issue caused by the triangulation of the stroke even
when fill wasn't needed. Now the fill buffer is only computed on demand.
2020-01-09 15:51:56 +01:00
746657fb9f Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-09 08:47:48 +01:00
d632971e48 Merge branch 'master' into greasepencil-object 2020-01-09 08:47:05 +01:00
af5d559f3f Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-08 22:50:16 +01:00
f568899db2 Merge branch 'master' into greasepencil-object 2020-01-08 22:47:30 +01:00
5da15bf180 GPencil: Continue loop if active frame is NULL 2020-01-08 19:22:59 +01:00
bcf23c5d5d GPencil: Tag datablock when init stroke 2020-01-08 19:17:43 +01:00
b6ff712af2 GPencil: Refactor: Remove last occurence of stl->storage 2020-01-08 18:06:51 +01:00
27bd836326 GPencil: Cleanup compiler warnings 2020-01-08 17:41:06 +01:00
10c5a7bb4c Cleanup: Add const 2020-01-08 17:35:27 +01:00
cb385abfe7 GPencil: Remove unused parameter 2020-01-08 17:30:49 +01:00
c8aad8defa GPencil: Cleanup - remove more ToDo and unused code 2020-01-08 16:56:53 +01:00
baeac830ae GPencil: Cleanup - Remove unused function 2020-01-08 16:49:01 +01:00
141885f9a7 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-08 16:39:31 +01:00
d7222a59c8 Merge branch 'master' into greasepencil-object 2020-01-08 16:38:45 +01:00
0af4a286bc GPencil: Cleanup unused code 2020-01-08 16:34:26 +01:00
0801557bef GPencil: Cleanup - Remove unused code and module 2020-01-08 16:32:18 +01:00
1a3bc6087c GPencil: Cleanup - Rename functions 2020-01-08 16:28:21 +01:00
67e38d313b GPencil: Cleanup 2020-01-08 16:22:36 +01:00
5af6cd1a22 GPencil: More cleanup 2020-01-08 15:46:18 +01:00
38630072f3 GPencil: More cleanup 2020-01-08 15:46:18 +01:00
b171e40d0c GPencil: Refactor: Fix outline depth mixing
This uses a costly depth reprojection in the fragment shader. This might
get optimized a bit in the future.

Unfortunately it's the only way to get the same accurate depth as what the
gpencil engine outputs.
2020-01-08 14:57:13 +01:00
d9f0885050 Gpencil: Refactor: Overlay: Fix crash when no gpencil object is active 2020-01-08 14:57:13 +01:00
2aee22c769 GPencil: First step to clear old code after refactoring
Still need more clear.
2020-01-08 13:10:31 +01:00
eea8144eb7 GPencil: Display Points and Edit lines by mode
Support different selection modes.
2020-01-08 12:43:54 +01:00
66d9c828b7 GPencil: Cleanup compiler warning 2020-01-08 11:04:24 +01:00
96d8f1b927 GPencil: Replace value by define
Instead to use hardcoded value, use the define.
2020-01-08 10:51:51 +01:00
6d84d2d301 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-08 10:24:56 +01:00
39aa15caca Merge branch 'master' into greasepencil-object 2020-01-08 10:24:14 +01:00
3b27d75f45 GPencil: Refactor: Add canvas grid 2020-01-07 20:15:41 +01:00
3cf0895bde GPencil: Refactor: Fix crash when using alt+b clipping 2020-01-07 20:15:41 +01:00
62f4eb5f1d GPencil: Refactor: Fix weight paint not working 2020-01-07 20:15:41 +01:00
31700ba657 Overlay: Allow alpha blend passes to write to the line buffer 2020-01-07 20:15:41 +01:00
eb6a46be2d GPencil: Move Strokes Directions to Overlays
Before was part of the datablock.

Also some cleanup in annotations.
2020-01-07 19:53:25 +01:00
1762cd3412 GPencil: Refactor: Add Weight Paint support 2020-01-07 17:42:23 +01:00
6ac1f2eff2 GPencil: Refactor: Overlay: Add hide selection option back 2020-01-07 17:42:23 +01:00
9722468109 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-07 17:00:42 +01:00
d834783387 GPencil: Enable Annotations by default in 2D template 2020-01-07 17:00:02 +01:00
96c238dddb GPencil: Add Annotation tools to Vertex Paint mode 2020-01-07 16:55:12 +01:00
b9b577e3d1 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-07 16:45:47 +01:00
7ac0d86582 GPencil: Fix several issues with Vertex Paint
Using big brush radius gets weird values.
Add missing some UI options
2020-01-07 16:45:06 +01:00
6d479b4d2b GPencil: Refactor: Fix crash in vertex paint mode 2020-01-07 15:48:32 +01:00
7025910e88 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-07 15:46:50 +01:00
35c2d3fb5d GPencil: Fix damaged Overlay panel in Vertex Paint mode 2020-01-07 15:46:29 +01:00
8c378e8517 GPencil: Fix damaged Overlay panel in Vertex Paint mode 2020-01-07 15:45:34 +01:00
55f38e453c GPencil: Refactor: Edit Mode: Add support for minor features
Add support for stroke color, vertex opacity and show stroke endpoints.
2020-01-07 15:30:41 +01:00
41c45aef96 GPencil: Refactor: Fix multiedit having less predecence than onion skin 2020-01-07 15:30:41 +01:00
d333b0c6cb GPencil: Refactor: Disable GPencil Outline in edit mode 2020-01-07 15:30:41 +01:00
a1285eb4d8 GPencil: Refactor: Edit Mode support. 2020-01-07 15:30:41 +01:00
75fc2bdf02 GPencil: Refactor: Fix old implementation crashing on startup 2020-01-07 15:30:41 +01:00
b83692e11a GPencil: Refactor: Replace Stroke Miter break by rounded corners
Also fix stroke ends being twice too long.
2020-01-07 15:30:41 +01:00
981c49ff4c GPencil: Refactor: Add outline overlay
This does not work correctly on square & dot strokes.

Also another issue is the depth blending. We need to fix the depth of
the outline geometry to match the 2D projection we do in the gpencil engine.
2020-01-07 15:30:41 +01:00
fb51417370 GPencil: Refactor: Move vertex shader logic to gpencil_common_lib.glsl
This is to be able to reuse the code in other engines/shaders.
2020-01-07 15:30:41 +01:00
93c9347e9c GPencil: Refactor: Use drawcall matrices instead of custom one 2020-01-07 15:30:41 +01:00
41cef139ad GPencil: Refactor: Move batch cache functions to DRW module
This is in preparation of drawing the overlays.
2020-01-07 15:30:41 +01:00
a0caa9e6b1 Cleanup: GPencil: Move GP_MATERIAL_BUFFER_LEN define to a common place 2020-01-07 15:27:51 +01:00
154fa8b853 GPencil: Refactor: Move iterator to BKE 2020-01-07 15:27:51 +01:00
94e18b10be Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-07 14:15:31 +01:00
fb83859278 Merge branch 'master' into greasepencil-object 2020-01-07 14:14:51 +01:00
025cc51a5a GPencil: Fix wrong functions name after merge 2020-01-07 12:55:42 +01:00
8a28f6e08d Merge branch 'greasepencil-object' into greasepencil-refactor
Conflicts:
	source/blender/editors/gpencil/gpencil_data.c
	source/blender/editors/gpencil/gpencil_edit.c
	source/blender/editors/gpencil/gpencil_utils.c
2020-01-07 11:38:39 +01:00
70264903a4 Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
2020-01-07 11:35:30 +01:00
0f09693f2a Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-07 09:16:28 +01:00
70eef1a800 Merge branch 'master' into greasepencil-object 2020-01-07 09:15:51 +01:00
f226d9007e Fix T72945: Can't Change the Thickness of a Stroke 2020-01-07 09:10:41 +01:00
8c32004af1 GPencil: Patch old files to enable layer lights switch
With the new switch at object level, the layers must be set to ON by default.
2020-01-06 22:46:45 +01:00
20e249274f GPencil: Move Use Lights to new Panel 2020-01-06 22:07:51 +01:00
1f0f71eb95 GPencil: Use main Use Lights switch at object level 2020-01-06 20:32:19 +01:00
a1b71fe54c GPencil: Remove Lights VFX
This has been replaced with real scene lights
2020-01-06 20:23:20 +01:00
30cc8a1f44 GPencil: Enable Use Lights for Layer for new layers
Now by default the option is ON because we have a new switch at object level.
2020-01-06 20:11:12 +01:00
e84f405e4c GPencil: New Use Lights flag at object level 2020-01-06 20:07:46 +01:00
d36378ab47 GPencil: Cleaunp compiler warning 2020-01-06 17:31:35 +01:00
cbb182cf53 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-06 17:29:32 +01:00
926b392b7d Merge branch 'master' into greasepencil-object 2020-01-06 17:28:49 +01:00
708d96cd63 GPencil: Change Monkey and Stroke primitives to linear color
Before it was using sRGB, but now all must be linear.
2020-01-06 17:14:16 +01:00
5abe5b154a GPencil: More changes to Simplify Tint 2020-01-06 17:08:21 +01:00
fa65619856 GPencil: First steps to add Simplify to refactor
Also, we have decided to reduce the number of simplify options because now it's not logic.

Still pending the tinting option.
2020-01-06 16:53:47 +01:00
b2b4d43e88 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-06 11:30:19 +01:00
4f9d4775a5 Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
2020-01-06 11:29:33 +01:00
f832a3c9b0 GPencil: Disable AA resource creation when enabling Simplify 2020-01-06 11:21:36 +01:00
c4120da72d GPencil: Disable AA using simplify 2020-01-06 11:16:02 +01:00
68ede39034 GPencil: Add new AA simplify option
Also some cleanup in other simplify options
2020-01-06 11:08:59 +01:00
0239f6eafb GPencil: Remove AA parameter from UserPrefs
This will be replaced by a simplify option with the new refactored drawing engine.
2020-01-06 10:56:57 +01:00
893c51ca98 Cleanup: Fix compiler warning 2020-01-06 10:45:13 +01:00
b20d1a4512 GPencil: Rename BKE functions to follow standard naming 2020-01-06 10:40:42 +01:00
a45cabf8f2 GPencil: Rename ED_gp_get_drawing_reference to ED_gpencil_drawing_reference_get 2020-01-06 10:31:24 +01:00
c283f9ffb0 Cleanup: Typo error 2020-01-05 12:51:01 +01:00
dc4564aae0 GPencil: Add ToDo comment 2020-01-05 12:28:34 +01:00
15c1a2a3fe Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-05 09:48:52 +01:00
f415fee0ab Merge branch 'master' into greasepencil-object 2020-01-05 09:48:12 +01:00
08a37ea5c1 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-04 22:03:38 +01:00
912b3dd1a5 Merge branch 'master' into greasepencil-object 2020-01-04 22:03:00 +01:00
bad96dfdce Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-04 19:33:36 +01:00
bf3900a555 Merge branch 'master' into greasepencil-object 2020-01-04 19:32:05 +01:00
0f7bde8f6f GPencil: Refactor: Add SMAA as Antialiasing solution
This removes the need of MSAA and the cost associated with it.
We run edge detection on both revealage and color buffer.

However the implemntation is not perfect: The source buffers are in linear
color space and the edge detection implies gamma corrected (display) space.
This mean the algorithm fails to capture some color changes. To workaround
this, we increase SMAA_LUMA_WEIGHT which has the same effect as decreasing
SMAA_THRESHOLD. This works ok in most scenes since GPencil objects have
clean and sharply defined shapes.
2020-01-04 17:42:09 +01:00
7fd76c2645 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-04 08:46:49 +01:00
b318024e7d Merge branch 'master' into greasepencil-object 2020-01-04 08:46:03 +01:00
f0ba75639a GPencil: Refactor: Fix frame drawn without color when in onion skin + loop 2020-01-04 00:34:22 +01:00
eca698867c GPencil: Refactor: Fix black GPobjects in hero files
This was due to missing light ubo. Now we use persistent uniform to avoid
missing a rebind.
2020-01-03 22:26:05 +01:00
94d228a4e4 GPencil: Refactor: Add stroke fast drawing
This use the same behavior as previous implementation. It uses a temp
buffer to store the screen and avoid redraw.

But this will be only on demand as the drawing may not match the final
look when releasing the pen. The UI option has not been added yet.

This mode still supports blending and VFX. Just stroke ordering with the
scene not supported.
2020-01-03 22:26:05 +01:00
08fa158f7a GPencil: Refactor: Improve current stroke drawing interleaving
This fixes issues with stroke sorting. The previous strokes were masking
the current stroke.
2020-01-03 22:26:04 +01:00
8a1cc77fdd GPencil: Refactor: Implement sbuffer stroke drawing
This is to be able to view strokes currently being drawn.
2020-01-03 22:26:04 +01:00
ce4005f806 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-03 10:07:00 +01:00
807fc09431 Merge branch 'master' into greasepencil-object 2020-01-03 10:06:16 +01:00
96a2c1bbc6 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-02 19:09:56 +01:00
b3b1e5f6c0 Merge branch 'master' into greasepencil-object 2020-01-02 19:09:10 +01:00
7f8b26aacf Cleanup: Fix compiler warnings 2020-01-02 13:01:01 +01:00
dd2f9525cb Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-02 12:55:40 +01:00
005df34aef Merge branch 'master' into greasepencil-object 2020-01-02 12:54:54 +01:00
12b5a1f919 GPencil: Fix missing Scale Thickness menu option
This was removed by error in merge.
2020-01-02 12:54:13 +01:00
7e014c9d06 Merge branch 'greasepencil-object' into greasepencil-refactor 2020-01-02 09:45:04 +01:00
6774c7bdb1 Merge branch 'master' into greasepencil-object 2020-01-02 09:43:31 +01:00
384f870f4d GPencil: Refactor: Add back gradient fill mode
For more consistent behavior, the radial gradient is drawn inside the 0..1
uv space as if it was a texture.
2020-01-02 02:01:54 +01:00
0de604f6ae GPencil: Refactor: Fix crash caused by material preview icons 2020-01-02 01:58:53 +01:00
9aff308902 Cleanup: GPencil: Fix Compiler warning about unused function 2020-01-01 03:58:32 +01:00
4d51bfecdb GPencil: Refactor: Fix onion overlay toggle
This make the assumption that the onion skins are always needed when.
This as a performance impact that will be fixed later.
2020-01-01 03:58:05 +01:00
1aeb21e56b GPencil: Refactor: Fix onion skining next frame drawing on top of active 2019-12-31 19:28:07 +01:00
589a889d23 GPencil: Refactor: Implement Onion skinning back
This new implementation changes a few things:
- The alpha is not dependent on the number of frames you choose to draw.
- The loop option affects more than one frame.
- The next frames are drawn on top of the active frame (TODO)
2019-12-31 19:28:07 +01:00
15525cac41 Cleanup: GPencil: Rename struct member 2019-12-31 19:28:07 +01:00
a6d30c064d GPencil: Refactor: Fix dot UV rotation at the end of strokes 2019-12-31 19:28:07 +01:00
6a51a61074 GPencil: Refactor: Remove image size from uv computation
Now UVs for line strokes is computed using only the pixel factor.
We can reintroduce the image size behavior easilly if needed but in a much
cleaner way.
2019-12-31 19:28:07 +01:00
6fead84d00 GPencil: Refactor: Fix issue with negative pressure
This happens to be a thing in some test file. Maybe at some point we will
patch them but for now we just fix the symptomes.
2019-12-31 19:28:07 +01:00
549a547f54 GPencil: Refactor: Add Stroke dot UV random rotation support
Note: This fixes a bug that was cropping the dots texture.
2019-12-31 19:28:07 +01:00
0d8a4528f7 GPencil: Refactor: Use stroke mask to cut dots shape
This removes the builtin fading of the dots. This should be reimplemented
as a material option for all stroke type instead.
2019-12-31 19:28:07 +01:00
3fc6f6c592 GPencil: Refactor: Add dot stroke object rotation mode 2019-12-31 19:28:07 +01:00
ac4abb99e9 Merge branch 'greasepencil-object' into greasepencil-refactor
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2019-12-30 19:44:30 +01:00
433ab9018b Merge branch 'master' into greasepencil-object 2019-12-30 19:42:06 +01:00
d4046f8c47 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-30 13:42:46 +01:00
594f3b0cac Merge branch 'master' into greasepencil-object 2019-12-30 13:41:49 +01:00
e6372a6ad6 Cleanup: Add missing space line 2019-12-30 11:18:58 +01:00
1e9098efc1 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-30 11:17:44 +01:00
2e5548f25e Merge branch 'master' into greasepencil-object 2019-12-30 11:17:08 +01:00
6557695c8c GPencil: Fix Transform Fill toolbar and menu
This was removed by error in a merge
2019-12-30 11:15:23 +01:00
3037c84937 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-28 13:30:52 +01:00
9ac0441536 Merge branch 'master' into greasepencil-object 2019-12-28 13:30:19 +01:00
84bf68186d Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-27 17:40:13 +01:00
6faa749192 Merge branch 'master' into greasepencil-object 2019-12-27 17:39:29 +01:00
d5cd4f31b1 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-26 13:17:48 +01:00
0d1a4fcfde Merge branch 'master' into greasepencil-object 2019-12-26 13:17:10 +01:00
69af3e82c0 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-25 11:22:42 +01:00
03e038208f Merge branch 'master' into greasepencil-object 2019-12-25 11:21:54 +01:00
b7d1cd3e00 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-23 12:56:12 +01:00
becb1df4cc Merge branch 'master' into greasepencil-object 2019-12-23 12:55:30 +01:00
8beb7c838f GPencil: Refactor: Stroke Caps: Fix a few issues
- Fix stroke cap flickering
- Fix broken cyclic strokes
- Increase corner split angle from 45° to 60°.
2019-12-23 01:56:43 +01:00
e42f30d45e GPencil: Refactor: Implement rounded caps
This was a bit tricky to do it cleanly. We create a mask using the stroke
point coordinates and extend the stroke geometry to uncover the mask if the
round caps are needed.

This was needed to be able to workaround the projection artifact of uvs.

Note that this code could be used for stroke shape in the future.
2019-12-21 21:11:30 +01:00
fe7558cbe2 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-21 16:03:42 +01:00
14b697c972 Merge branch 'master' into greasepencil-object 2019-12-21 16:01:13 +01:00
c1bd862d3a Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-21 08:52:40 +01:00
a89beff293 Merge branch 'master' into greasepencil-object 2019-12-21 08:51:57 +01:00
6af1309e05 GPencil: Refactor: Make light power match cycles and EEVEE
This was eyeballed with colormanagement being off. So I wouldn't be
surprise if this comes out not perfect.
2019-12-21 01:53:15 +01:00
42580ddf92 GPencil: Refactor: Use more correct depth merge approximation for 2D object
We now use a plane that follows the computed shading normal.
The plane follows the camera rotation but also takes the gpobject volume
into account.
2019-12-21 01:21:46 +01:00
685c94eacb GPencil: Refactor: Use normal approximation for lighting
We compute the normal using the bounding box size and the view vector to
the center of the bounding box. We then scale the normal w.r.t. the BBox
size and transform it back to world space. This gives us a flat normal
for objects without depth and a rotating normal for object that are
not.

This will also be used for correct depth mixing.
2019-12-21 01:21:46 +01:00
c5492121df GPencil: Only patch grease pencil objects 2019-12-20 19:35:08 +01:00
9e10f0ef15 GPencil: Patch colors to Linear
All colors have been patched to Linear and also changed to PROP_COLOR instead of PROP_COLOR_GAMMA.

The colors have been patched in VFXs and Modifiers.
2019-12-20 19:27:48 +01:00
40528d14f9 GPencil: Remove use_solo_mode from Top Layer Popover 2019-12-20 16:55:40 +01:00
4d1ebfb55e Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-20 16:37:32 +01:00
1ee25cbebb Merge branch 'master' into greasepencil-object 2019-12-20 16:36:47 +01:00
f6e760b1fd GPencil: Change Eyedropper and Curve conversion to Linear 2019-12-20 16:34:04 +01:00
241ceceac8 GPencil: fix compilation error 2019-12-20 13:53:05 +01:00
c0ecde568e Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-20 10:46:32 +01:00
ceec52a45c Merge branch 'master' into greasepencil-object 2019-12-20 10:45:54 +01:00
38d0e417f4 GPencil: Remove temp color conversion to Linear 2019-12-20 10:43:15 +01:00
a00fdc2898 GPencil: Patch old files color to Linear
Still pending to review VFX and Modifiers.
2019-12-20 10:38:43 +01:00
8f9c04762e GPencil: Refactor: Blur Fx: Implement DoF option and fix radius world size
The size of the blur is now proportional to the distance to the camera
and the object scale (just like any other effects).

The Depth Of Field now works and always match the Circle of confusion of
cycles/EEVEE.
2019-12-20 01:51:20 +01:00
ec5b795d11 GPencil: Refactor: First step to get rid of sRGB
This patch removes sRGB from the rendering pipeline. All color that
enters shading is a Linear color. Only the final composite shader is
still using sRGB as display transform for now (will later be replaced by
full OCIO transform).
2019-12-20 00:14:16 +01:00
c0981f4a15 GPencil: Refactor: Add world ambient lighting 2019-12-19 22:38:51 +01:00
3d2d9c7c5a GPencil: Refactor: Implement "Use Lights" toggle
We use a ubo containing only a white ambient light to simulate no lighting.
2019-12-19 22:38:22 +01:00
907e99d08d GPencil: Refactor: Add other light types
We approximate area lights using the same code used by spot lights.
2019-12-19 21:20:36 +01:00
2d3e86f2b0 GPencil: Refactor: Add new basic light system
This new light system for now only support point lights.

The number of lights is limited to 128.
2019-12-19 21:20:36 +01:00
0900fa01c6 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-19 17:41:33 +01:00
0818565d0b Merge branch 'master' into greasepencil-object 2019-12-19 17:40:45 +01:00
6f84cef51a GPencil: Change tooltip 2019-12-19 17:26:44 +01:00
3d7a8062af GPencil: New Use Lights option for Layers
This switch will be used to enable layer affected by scene lights.
2019-12-19 17:23:34 +01:00
bef31e42e1 GPencil: Fix compiler error 2019-12-19 16:49:47 +01:00
58abc19dde Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-19 14:42:33 +01:00
76567d6817 Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/properties_paint_common.py
	release/scripts/startup/bl_ui/space_view3d.py
2019-12-19 14:41:30 +01:00
59b38297d1 GPencil: More changes after merge 2019-12-19 14:39:59 +01:00
22b700247b merge 'master' into greasepencil-object branch 2019-12-19 14:30:51 +01:00
53de7a6620 GPencil: Remove Transparent option in Swirl VFX
This has been deprecated.
2019-12-19 14:23:17 +01:00
ec3f0b7336 GPencil: Versioning patch for Colorize VFX
The old Gray and Sepia modes were not using the factor and now the blend is defined with that, so need to be set to 1.0f
2019-12-19 11:35:24 +01:00
12304efda8 GPencil: Display Colorize Factor for all modes
Now the factor is used in all modes.
2019-12-19 11:04:04 +01:00
b2cb2a703a Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-19 08:57:38 +01:00
408565a8dd Merge branch 'master' into greasepencil-object 2019-12-19 08:57:01 +01:00
96a3029ab9 GPencil: Fix missing mask icon in Dopesheet
The new mask icon was not displayed in Dopesheet channel.
2019-12-19 08:55:41 +01:00
0cc5a2bfd1 GPencil: Refactor: Add Swirl FX
The angle is no longer mulitplied by 8. We need to change the UI and patch
old files to preserve an appropriate slider feeling.

The Swirl FX (like others) is now affected by distance of the source object.

Transparent option has not been reimplemented as you can use masking for
that.
2019-12-19 01:30:54 +01:00
0509f4149e GPencil: Refactor: Add Wave FX
Use the same shader as flip fx because we only transform the uvs and
sample once.
2019-12-19 01:30:54 +01:00
27fa133435 GPencil: Refactor: Add Flip FX 2019-12-19 01:30:54 +01:00
c2d56d7caa Cleanup: GPencil: CamelCase for uniform and fix a wrong comparison 2019-12-19 01:30:54 +01:00
d56f1a5f44 GPencil: Refactor: Add Rim FX
Nothing has changed functionality wise.
2019-12-19 01:30:54 +01:00
c42ceb93c9 GPencil: Refactor: Put blend mode shader code into gpencil_common_lib.glsl
This is because the rim fx needs the same code.
2019-12-19 01:30:54 +01:00
7359bec21b GPencil: Refactor: Add Colorize FX
The behavior has been changed quite a bit to work with separated
transparency layer.

- The custom mode now just blend between the original image and the
  same image with the color changed and luma kept as is.
- Grayscale & Sepia mode now blend with the original image using the factor.
- The duo tone do not do a sharp separation of colors. It just color the
  original in 2 different color using a hard separation threshold.
2019-12-19 01:30:54 +01:00
6f6c25c681 GPencil: Set default VFX Shadow color to Gray 2019-12-18 19:16:24 +01:00
ce5e4f76dc Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-18 15:51:13 +01:00
b6dc2e4ba0 Merge branch 'master' into greasepencil-object 2019-12-18 15:50:38 +01:00
b4b08e37f0 GPencil: Remove arbitrary limit to only one VFX 2019-12-18 15:31:30 +01:00
426c04b921 GPencil: Change default values for Blur VFX 2019-12-18 15:28:01 +01:00
f9023f5196 GPencil: Replace hardcoded factor by definition 2019-12-18 10:54:44 +01:00
fa6a26e391 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-18 10:38:21 +01:00
c5e3ee26e7 Merge branch 'master' into greasepencil-object 2019-12-18 10:37:40 +01:00
eb5c5b3504 GPencil: Fix Layer UI 2019-12-18 03:13:59 +01:00
4f08463279 GPencil: Refactor: Add Shadow Effect
All the parameters are now locked in world space following the object
center.
2019-12-18 03:13:59 +01:00
2e5d299823 GPencil: Refactor: Add Glow effect
The glow effect is now additive. You cannot make black "glow" (whatever
that meant).
2019-12-18 03:13:59 +01:00
f2bc524e64 GPencil: Refactor: Add Pixelize effect
Bonus: the pixelize effect use the center of the object as pixelization
center. This improves stability of the effect.

We also use a 2pass downsampling to reduce the flickering.

The pixel size is now fixed in world space and dependant of object scale
and distance to camera.
2019-12-18 03:13:59 +01:00
3520b3379c GPencil: Refactor: FX: make the Blur not dependant on sampling parameter
The sampling parameter was in fact use as iteration step count in previous
implementation. New behavior is much more consistent and predicatble
2019-12-18 03:13:59 +01:00
38f537c588 GPencil: Refactor: Add invert masking 2019-12-18 03:13:59 +01:00
2d751d44ee GPencil: Refactor: Base implementation of VFX for gpencil
This new implementation is clearer and also process the colored alpha
compoment to preserve blending informations.

This is the base implementation containing a placeholder blur.

All the real effect implementation will follow in separate commits.
2019-12-18 03:13:59 +01:00
ecd3e224fa Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-17 19:56:30 +01:00
e2e89e92fe Merge branch 'master' into greasepencil-object 2019-12-17 19:55:43 +01:00
4a10a740eb Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-17 17:30:38 +01:00
9ddb20f9a3 Merge branch 'master' into greasepencil-object 2019-12-17 17:29:28 +01:00
bb0fc04609 Merge branch 'master' into greasepencil-object 2019-12-17 17:22:42 +01:00
42c7d533b6 merge branch 'master' into greasepencil-object 2019-12-17 17:19:11 +01:00
3673766ab9 GPencil: Hide Stroke panel for tools not equal to DRAW 2019-12-17 16:22:32 +01:00
e70cbd7208 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-17 15:58:28 +01:00
34a700dbc3 Merge branch 'master' into greasepencil-object 2019-12-17 15:57:49 +01:00
78d7b2b80a Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-17 08:53:55 +01:00
4fcfa08411 Merge branch 'master' into greasepencil-object 2019-12-17 08:53:17 +01:00
f6f30b490a GPencil: Remove Blur VFX limit of 1 effect 2019-12-17 08:49:47 +01:00
3fa64fe9b8 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-16 18:56:59 +01:00
cfb314bec4 Merge branch 'master' into greasepencil-object 2019-12-16 18:55:31 +01:00
d811bb724e GPencil: Move Stabilize Stroke subpanel lto bottom 2019-12-16 17:33:17 +01:00
f395e966bb GPencil: Cleanup commented lines of previous commit 2019-12-16 17:23:27 +01:00
e85354b15d GPencil: Group Brush panels in Stroke popover
Use too many popovers reduce space for layer popover.
2019-12-16 17:22:04 +01:00
60dac83b6e GPencil: Change again Eraser cursor to Display Cursor 2019-12-16 17:05:11 +01:00
8df7dfc85a GPencil: Change Show Brush to Show Cursor for Eraser 2019-12-16 17:00:51 +01:00
37f02905e7 GPencil: Change Cursor Panel texts 2019-12-16 16:59:51 +01:00
2ab0a44399 GPencil: Add cursor color for Tint 2019-12-16 16:26:17 +01:00
2f20d5ea13 GPencil: Ensure storage is initializated for renders
This failed in material preview generation.
2019-12-16 16:09:38 +01:00
01a8c68aca Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-16 15:41:12 +01:00
600ae498b3 Merge branch 'master' into greasepencil-object 2019-12-16 15:40:30 +01:00
a99ea06507 GPencil: Hide Panels depending of Tool 2019-12-16 15:39:56 +01:00
02836f3777 GPenciL: Fixes in UI
- Fix Sculpt stroke panel.
- Fis Subtract color in Cursor Panel.
- Move Boundary to Advanced panel
2019-12-16 15:31:23 +01:00
6662662fd8 GPencil: Remove duplicate custom cursor 2019-12-16 13:23:05 +01:00
cdb37889c5 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-16 12:38:29 +01:00
a16a6e2483 GPencil: Add missing options to Image menu after merge master 2019-12-16 12:35:22 +01:00
7e6e153799 Merge branch 'greasepencil-object' into greasepencil-refactor
Conflicts:
	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
	release/scripts/startup/bl_ui/space_view3d_toolbar.py
2019-12-16 10:56:05 +01:00
286ccc49b3 Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/properties_data_modifier.py
	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
	release/scripts/startup/bl_ui/properties_paint_common.py
	release/scripts/startup/bl_ui/space_view3d.py
	release/scripts/startup/bl_ui/space_view3d_toolbar.py
2019-12-16 10:49:05 +01:00
e929968511 GPencil: Fix more damaged panels 2019-12-16 10:43:06 +01:00
5d8ed832a4 GPencil: Refactor: Fix mask blending 2019-12-16 01:18:32 +01:00
0742bc5087 Cleanup: GPencil: Simplify drawing logic. 2019-12-16 01:07:13 +01:00
0edf755317 GPencil: Refactor: Fix mask system not working in some scenes 2019-12-15 23:55:40 +01:00
e38cc86e78 GPencil: Add missing Vertex Panel 2019-12-15 23:46:09 +01:00
261c06019f GPencil: More UI fixes after merge
Still more issues pending.
2019-12-15 23:42:49 +01:00
c118b670f6 GPencil: First step to fix damaged UI by Brush panel refactor done in master
The patch done in master was done before the Sculpt and Weight brushes were real brushes and also before the Vertex Paint mode was implemented. As result of that, the merge of master has broken almost all panels of brushes and all Vertex Paint mode.

This commit only fix part of the damages.
2019-12-15 20:30:49 +01:00
a0b953374a GPencil: Refactor: Implement Opacity Masking
This is better than previous implementation but has a higher cost.

We render masked layer to a RGBA16F buffer and we then mask the revealage
and the color in a 2 pass blending.

This could maybe optimized a bit to reduce to 1 blending on recent hardware
but the cost will still be way higher than the stencil method.

On the plus side, there is less code change than with the stencil.
2019-12-15 15:42:11 +01:00
5e72f70d76 Revert "GPencil: Refactor: Add Top to bottom layer masking using stencil"
This reverts commit 6bcd877ebb.
2019-12-15 14:02:43 +01:00
5eacb5b237 Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
	release/scripts/startup/bl_ui/properties_paint_common.py
	release/scripts/startup/bl_ui/space_topbar.py
	release/scripts/startup/bl_ui/space_view3d.py
	release/scripts/startup/bl_ui/space_view3d_toolbar.py

This commit has broken all new graese pencil Vertex Paint, Sculpt mode
and Weight mode and need a review.
2019-12-15 11:18:51 +01:00
6bcd877ebb GPencil: Refactor: Add Top to bottom layer masking using stencil
This uses the 8bits as binary mask layer. This is really
efficient but has the downside of not allowing gradient transparency.

This also allows for different masking ranges and even (maybe) masking
boolean operations (nested masks etc..) but implementing this sort of
this might complexify the UI and the implementation.

The reason we went for binary visibility is that our blending modes
cannot operate correctly if not using a bottom-up rendering of the
layers (due to low precision color buffers). So blending all masked
layers to another temp buffer or blending layer top to bottom is not
doable without loosing the blending features. The workaround for this
would be to use RGBA16F everywhere and use many double buffers. Which
would kill performance and is really unpractical.

Now we just limit the number of masks to be 8. Lifting this limit
is a todo.
2019-12-15 03:42:46 +01:00
9469f13b73 GPencil: Refactor: Fix crash caused by material preview render 2019-12-15 03:19:11 +01:00
3d78e02837 DRW: Add DRW_shgroup_stencil_set to set all stencil test values
This is to allow more fine tuning. The other function is
deprecated and need to be replace.
2019-12-15 03:14:19 +01:00
f8661a89f5 Revert "GPencil: Refactor: Change Mask Behavior"
This reverts commit eb3fe4c848.
2019-12-14 20:30:50 +01:00
eb3fe4c848 GPencil: Refactor: Change Mask Behavior
This is a work in progress Masking now done by a particular layer and
applied on all layers underneath.
2019-12-14 18:58:52 +01:00
8d6737a168 GPencil: Refactor: Fix broken selection 2019-12-14 18:58:52 +01:00
ecc5a50683 Cleanup: Sort flag options 2019-12-14 12:50:50 +01:00
d605ff84fb Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-14 10:02:15 +01:00
3b0ec6592b Merge branch 'master' into greasepencil-object 2019-12-14 10:01:38 +01:00
8ea92115f3 GPencil: Refactor: Speedup: Only blend pixels rendered in the layer 2019-12-14 03:31:10 +01:00
a3c998e4f3 GPencil: Refactor: Implement Layer Masking 2019-12-14 03:21:50 +01:00
fd548dea3c GPencil: Refactor: Fix Overlay Blend mode
There was a mistake in the implementation. The step were reversed and
alpha was affecting the blend result.
2019-12-14 03:21:29 +01:00
2cef0182fb GPencil: Refactor: Add depth merge pass
This pass merge the stroke depth to the 3D depth buffer. This makes GP objs
to mask overlays correctly.

2D objects depth is using the object center depth only. This is to be
improved.
2019-12-14 02:45:37 +01:00
dc2cc35a7b Cleanup: GPencil: CamelCase for uniforms 2019-12-14 02:39:21 +01:00
fc239df81c GPU: Framebuffer: Fix missing color mask 2019-12-14 02:36:59 +01:00
ecfb0b1273 GPencil: Refactor: Fix 3D stroke offset
The offset was way too big.
2019-12-13 21:25:07 +01:00
b9bcc12eb9 GPencil: Refactor: Add depth test in the fragment shader
Now the GPencil object can correctly intersect the scene.

Previously (old implementation) 2D GPencil objects would poke through
in front meshes in certain situations (depending on stroke order). This is
now fixed.

This does not fix the intersection with the overlays.
2019-12-13 21:24:12 +01:00
29b4dc1d16 GPencil: Refactor: Fix overlay blending math
A sign error in optimized code.
2019-12-13 20:18:29 +01:00
347a097a62 GPU: Texture: Fix mistake in format classification
sRGBA format is well defined for use with framebuffers (based on 3.3 spec).
2019-12-13 19:40:29 +01:00
436696b087 Cleanup: GPencil: Remove duplicated code 2019-12-13 19:40:29 +01:00
170680b544 GPencil: Refactor: Add support for layer blending
This break the compatibility of old blend files as the old implementation
was done incorrectly.

With new implementation, the layer blending can affect multiple object
and in certain case affect even the rendered background. Old implementation
was only affecting the layers beneath, not other objects.

This implementation is also ready to support vfx on top.

Some blend modes (divide and subtract) have some limitations. They cannot
be propagated to other objects. This is because we would need to use
signed float buffers everywhere (for background render) so that fixed
function blending does not clamp the blending values.
2019-12-13 19:40:29 +01:00
18c4fcb9a3 DRW: Add subtract blend logic
This is to support subtract blending with Multiple Render Targets
2019-12-13 19:40:29 +01:00
db21312bfb GPU: Framebuffer: Add GPU_framebuffer_multi_clear
This is to clear individual targets using a different color.
2019-12-13 19:40:29 +01:00
4ba94091be GPencil: Refactor: Add offscreen compositing foundation
This put all Grease pencil drawing into a separate buffer that is then
composited on top of the rendered image.

This framebuffer has 2 RGB color target (one color and one alpha) to be
able to record any color blend types.

Moreover these buffers are floating point (R11_G11_B10) which will allow
the use of linear colors.
2019-12-13 19:40:29 +01:00
4fbf78996b Merge branch 'greasepencil-object' into greasepencil-refactor
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2019-12-13 16:29:05 +01:00
200d8a1732 Merge branch 'master' into greasepencil-object 2019-12-13 16:27:29 +01:00
ab5a4bc51c GPencil: Refactor: Fix broken shader & undefined behavior 2019-12-13 00:34:32 +01:00
81436b95bd GPencil: Refactor: Implement Object sorting 2019-12-12 22:33:21 +01:00
3adcfeac96 GPencil: Refactor: Implement Stroke self overlap option
This is a novel approach were we use the depth buffer instead of the
stencil buffer. This allows up to ~1e24 different indices to draw to.
We use a DRW_STATE_DEPTH_GREATER to discard the fragment comming from the
same stroke.

Since we can have strokes that don't have this option, we use the point
indices instead of the stroke index to avoid changing the state during
drawing.
2019-12-12 22:33:21 +01:00
84b1a70f0d Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-12 20:24:38 +01:00
1682d9ff03 GPencil: Fix missing context menu in Sculpt 2019-12-12 20:24:00 +01:00
cb79f1b2cd Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-12 16:03:06 +01:00
ba78abef68 Merge branch 'master' into greasepencil-object 2019-12-12 16:02:29 +01:00
294b6730fe GPencil: Disable line for testing 2019-12-12 15:52:48 +01:00
9670645ccf GPencil: Remove Stencil Mask and Mix for Fill material
This is part of the refactor of the darwing engine.
2019-12-12 15:50:56 +01:00
bdb4e2b1c4 GPencil: Fix old files using Stencil Mask 2019-12-12 15:39:21 +01:00
1fbd437ccf GPencil: Remove properties use_stroke_pattern and use_stroke_texture_mix
WIP: Still the flags are used in drawing code to keep old files running and compare results. Need to be removed later.
2019-12-12 10:07:51 +01:00
80ed3e12e4 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-12 09:34:15 +01:00
d3c4d98246 Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/properties_data_modifier.py
	release/scripts/startup/bl_ui/properties_paint_common.py
	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
2019-12-12 09:32:36 +01:00
458fa4c213 GPencil: Set Vertex Paint Opacity and Tint Factor to PROP_FACTOR 2019-12-12 09:30:04 +01:00
5cf56f6ae8 GPencil: Refactor: Implement layer tint 2019-12-12 03:05:48 +01:00
6e1eaa9160 GPencil: Refactor: Fix Fills texture color mixing 2019-12-12 02:47:49 +01:00
9ad8f9e3ba GPencil: Refactor: Add Dots & Square drawing type
Also add vertex color opacity
2019-12-12 02:24:20 +01:00
2494b982dd GPencil: Refactor: Improve stroke color mixing support
This is a more simple implementation. Blending is done in a way that it
supports the stencil functionallity out of the box. It is compatible with
vertex paint, stroke material color and texture color without exclusivity.

UI need to be reworked to remove the stencil option.
2019-12-12 02:24:20 +01:00
f883a9c9bb GPencil: Refactor: Add UV / Texture support to strokes 2019-12-12 02:24:20 +01:00
ea879f340a GPencil: Change order of the UI parameters for materials 2019-12-11 17:48:37 +01:00
2246ea1557 GPencil: Change step for Mix factors
The old step value was too high.
2019-12-11 17:31:33 +01:00
01af5f1768 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-11 16:48:11 +01:00
ff7e734f8c Merge branch 'master' into greasepencil-object 2019-12-11 16:46:48 +01:00
ce5454091c GPencil: Remove Checker Fill mode
This mode is redundant with textures and only adds complexity for something that can be solved easily using a checker texture.

Also, old files are patched as SOLID fill.
2019-12-11 16:43:27 +01:00
0f9486f4a4 Gpencil: Cleanup unused code 2019-12-11 16:19:53 +01:00
daf1a4f4fb Cleanup: GPencil: Use different random values for random effects 2019-12-11 16:15:35 +01:00
b1ac81095f Cleanup: GPencil: Rework code for clarity and remove compiler warnings
This should not change anythign
2019-12-11 16:18:41 +01:00
985a9dba61 GPencil: Refactor: Add basic vertex color support 2019-12-11 14:20:09 +01:00
25af6df87d GPU: VertexFormat: Fix assert off by one 2019-12-11 14:19:43 +01:00
a703faf38c GPencil: Fix error in Transform Fill
This code was damaged during a merge.
2019-12-11 11:39:53 +01:00
01eec04454 GPencil: Fix TRansform Fill UV error
During a merge, we removed this by error.
2019-12-11 11:31:11 +01:00
2d3c2510b9 GPencil: Rename "Boxes" mode to "Squares" 2019-12-11 10:35:50 +01:00
5f08a28304 GPencil: Remove ol UV data from triangle struct 2019-12-11 10:29:33 +01:00
6200ea886c GPencil: Refactor: Implement Checker Fill type
This is not matching the old implementation as the tranform order is
different. We may patch older files to match new impelementation.
2019-12-11 03:06:48 +01:00
076eb5c87a GPencil: Refactor: Add support for fill textures 2019-12-11 03:06:48 +01:00
018d778451 GPencil: Refactor: Put fill uvs into bGPDspoint
This is not the best place but that's a temporary solution.
2019-12-11 03:06:48 +01:00
24e6b2702d GPencil: Refactor: Rename gpencil_data.c to gpencil_draw_data.c
This is to avoid confusion with the already existing gpencil_data.c.
2019-12-11 03:06:48 +01:00
9d866f8b75 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-10 20:02:28 +01:00
969bb04703 GPencil: Fix errors after merge 2019-12-10 20:01:44 +01:00
89aa1a7f60 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/paint.c
2019-12-10 19:45:16 +01:00
9e448b035b GPencil: Remove UV from RNA
These were only for debug and now are not required
2019-12-10 19:09:45 +01:00
d2525ea872 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-10 14:10:14 +01:00
54c2f2644b Merge branch 'master' into greasepencil-object 2019-12-10 14:07:47 +01:00
6c608a25da GPencil: Moves filling recalc to evaluation section
Now, instead to recalc the filling of the strokes at drawing level, the calc is done when the derived frame is created after a depsgraph tag.

This separate the drawing of the evaluation process.
2019-12-10 12:17:59 +01:00
6bb9ec58d2 GPencil: Move cache recalc functions to shared module
This is the first step to move the recalc of the filling to the evaluation area (like modifiers) and not in the draw manager that must only draw.
2019-12-10 12:03:30 +01:00
456a2970ad Merge branch 'master' into greasepencil-object 2019-12-10 10:32:33 +01:00
910dea651c Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-10 02:11:32 +01:00
7734b00563 GPencil: Refactor: Add basic Material color support via UBO
For now there is at least one UBO per object. It is kept relatively small
to avoid overhead. When we implement sharing of UBOs accross objects we
could increase the material count per UBO and reduce the binding overhead.

This also put the BLI_memblocks in the ViewLayer instead of the viewport
storage list. This is because we need to correctly free UBOs when blender
quits. This can become a problem in the future but there are other places
like this in other engines so we should fix them all at once.
2019-12-10 01:43:41 +01:00
980d1d5527 BLI_memblock: Fix BLI_memblock_destroy not freeing all elements
This was happening if BLI_memblock_destroy was called on a memblock that
has not been cleared first.
2019-12-10 01:36:49 +01:00
5d80b481b4 GPencil: Refactor: Avoid crash when using the render pipeline 2019-12-10 01:01:19 +01:00
6d83b3ee3f Merge branch 'master' into greasepencil-object 2019-12-09 20:28:42 +01:00
a1f7ef4285 GPencil: Refactor how sample pixel 2019-12-09 18:24:15 +01:00
c9e4cc4f43 Merge branch 'master' into greasepencil-object 2019-12-09 16:57:26 +01:00
c5892a1c7d GPencil: Move get pixel function to shared module
Instead to have the code two times, move to BKE and share.
2019-12-09 16:56:24 +01:00
1f185740c4 GPencil: Refactor: Fix stroke end segment not drawn because of 180° angle
We just use safe normalize now. This just draw straight lines if the angle
is too sharp (or no lines at all if the line is parallel to the view).
2019-12-09 16:37:08 +01:00
4760d44e82 GPencil: Refactor: Rename variables to match naming convention 2019-12-09 15:48:57 +01:00
afecc4e976 GPencil: Refactor: Fix fill stroke indices 2019-12-09 14:02:38 +01:00
935198aa8a GPencil: Refactor: Fix miter of endpoints 2019-12-09 13:35:47 +01:00
02b25005a9 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-09 02:28:46 +01:00
090127099d GPencil: Refactor: Quick implementation of object matrices
This is just for testing. Not the final implementation
2019-12-09 02:28:06 +01:00
3701305e87 GPencil: Refactor: Add quick 3D/2D stroke ordering for testing 2019-12-09 02:16:40 +01:00
32b8eab5cf GPencil: Refactor: Add thickness support
This add CORRECT support for worldspace thickness to GPencil stroke.

However it does not perfectly match old implementation which was buggy.

Mitigation could be done via doversion but it is not the goal of this
commit.
2019-12-09 01:50:17 +01:00
6eb61d23c5 Merge branch 'master' into greasepencil-object 2019-12-08 17:06:14 +01:00
19e00afad9 GPencil: Fix error when srink stroke with Alt+S 2019-12-08 17:05:34 +01:00
6805012c48 GPencil: reduce pixel size in conversion 2019-12-08 17:00:32 +01:00
e87804f2ba GPencil: Refactor: Implement Miter corner logic
Not 100% complete, needs to fix the "corner" cases.
2019-12-08 15:14:57 +01:00
556d76c585 GPencil: Some tweaks to Generate from Image operator 2019-12-08 13:57:39 +01:00
a05408220d GPencil: New operator to generate Grease Pencil from images
This takes a image and generate a new grease pencil object and each pixel is a vertex point. THe image is generated by lines.

As an option, an inverted  mask can be generated
2019-12-08 13:16:58 +01:00
85da33681d Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-08 01:26:50 +01:00
8e3c891229 GPencil: Refactor: Add back basic fill drawing 2019-12-08 01:26:11 +01:00
a5e6e56a6d GPencil: Refactor: Draw gpencil strokes using instanced quad
Using the instance range drawing (DRW) & the attrib multiload (GPU) we
use the instancing of quad geometry to draw arbitrary thick lines using
only the vertex shader.
2019-12-08 01:23:17 +01:00
f7fc37e46c GPUVertFormat: Add GPU_vertformat_multiload_enable
This add the possibility to fetch multiple adjacent vertex data in a single
vertex shader invocation.
2019-12-08 01:18:27 +01:00
82c135816f Draw Manager: Add new DRW_shgroup_call_instance_range
This is to be able to create drawcalls that only render a range of the
instance buffer.

Very needed for the new GPencil stroke rendering.
2019-12-08 01:15:27 +01:00
bef4d2bf69 Merge branch 'master' into greasepencil-object 2019-12-07 20:03:34 +01:00
10c1823899 GPencil: Refactor: Use iterator to populate draw passes
Also remove a bug in gpencil_batch_cache_valid that prevented the use
of gpencil_batches_ensure more than once per redraw.
2019-12-07 18:22:16 +01:00
3d18884115 Merge branch 'greasepencil-object' into greasepencil-refactor 2019-12-07 14:57:14 +01:00
12034dc4aa GPencil: Refactor: Add new logic to create batches and store draw passes
We introduce a new set of temp objects (GPENCIL_tVfx, GPENCIL_tLayer,
GPENCIL_tObject) allocated in BLI_memblocks to allow fast traversal and
easy memory management.

We also introduce an iterator to iterate over visible strokes of an object
to avoid code duplication.

Strokes are all in one batch and the fill batch will only contain indices
to the stroke buffer.

For now the objects are only drawn at the center only with white 1px stroke
and all strokes are not interupted (the finish at center).
2019-12-07 14:56:27 +01:00
5c78ab5f6f Merge branch 'master' into greasepencil-object 2019-12-06 19:37:28 +01:00
e6fc0a39de GPencil: Use debug_value of 50 for testing new refactor
This is in order to test continuously while being able to compare against
previous implementation alongside.
2019-12-06 13:37:42 +01:00
71c7083e1e GPencil: Avoid full filling when no borders 2019-12-06 11:22:33 +01:00
669209b530 Merge branch 'master' into greasepencil-object 2019-12-06 10:27:52 +01:00
6e92345115 Merge branch 'master' into greasepencil-object 2019-12-05 13:46:47 +01:00
71ca840736 Merge branch 'master' into greasepencil-object 2019-12-05 10:20:40 +01:00
f2985489c2 Merge branch 'master' into greasepencil-object 2019-12-04 16:08:32 +01:00
f3e0287ca8 Merge branch 'master' into greasepencil-object 2019-12-04 14:35:09 +01:00
b50a7272f6 Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
	release/scripts/startup/bl_ui/space_dopesheet.py
	source/blender/blenloader/intern/versioning_defaults.c
	source/blender/editors/animation/anim_channels_defines.c
2019-12-04 14:30:08 +01:00
3b6d39cc8f Merge branch 'master' into greasepencil-object 2019-12-04 10:06:52 +01:00
723db77e10 GPencil: Fix memory leak with sliders 2019-12-03 17:45:20 +01:00
9db6144e4e Merge branch 'master' into greasepencil-object 2019-12-03 16:17:41 +01:00
cb7440201a Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
2019-12-03 12:13:04 +01:00
405074f674 Merge branch 'master' into greasepencil-object 2019-12-03 11:20:54 +01:00
fdb4dc3413 GPencil: Remove duplicate panel code for layer properties
Now it uses a parent class for both panels.
2019-12-03 11:20:27 +01:00
342f9dfd5b Merge branch 'master' into greasepencil-object 2019-12-02 20:02:45 +01:00
0e4e7972d7 GPencil: Fix error after merge 2019-12-02 17:26:11 +01:00
cdae1ae99c Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/intern/draw_manager.c
2019-12-02 17:22:09 +01:00
13af059ed7 Merge branch 'master' into greasepencil-object 2019-11-30 17:09:50 +01:00
4b6c83a002 GPencil: Change tooltip 2019-11-30 17:02:44 +01:00
ee91697acb GPencil: Fix Time modifier error for frame Zero 2019-11-30 17:02:10 +01:00
e83beb786a Cleanup code 2019-11-30 16:48:12 +01:00
d646652d60 GPencil: Add option to scale thickness 2019-11-30 16:47:01 +01:00
ad80045128 GPencil: Show Vertex Paint parameter in Overlay in Object mode
Also hide depending of shading modes.
2019-11-30 16:21:20 +01:00
d7a9d0d9c3 Revert "GPencil: Object mode always use Vertex Paint mix"
This reverts commit 578db1e1a6.
2019-11-30 16:08:52 +01:00
578db1e1a6 GPencil: Object mode always use Vertex Paint mix 2019-11-30 13:47:45 +01:00
11516a14dc GPencil: Transform thickness when transform Scale in Edit mode 2019-11-30 13:32:05 +01:00
2883ce0311 GPencil: Fix versioning code after merge 2019-11-30 11:55:51 +01:00
0e8e0e3203 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2019-11-30 11:49:38 +01:00
7e4be8e629 GPencil: Update when shading mode changes 2019-11-29 23:51:54 +01:00
15f5cc7064 GPencil: Don't disable Vertex paint if Material mode 2019-11-29 23:48:02 +01:00
8418544a4d Merge branch 'master' into greasepencil-object 2019-11-29 23:15:42 +01:00
319df22970 GPencil: Fix error when parent a layer to Bone and don't scale thickness 2019-11-29 22:51:32 +01:00
8e7cc66522 Merge branch 'master' into greasepencil-object 2019-11-29 16:27:53 +01:00
62f45141ef Merge branch 'master' into greasepencil-object 2019-11-29 11:25:45 +01:00
5dab2575ae Merge branch 'master' into greasepencil-object 2019-11-29 10:28:01 +01:00
4d8de9a9b1 GPencil: Implement Vertex Overlay and set Vertex as default
Now in Material Overlay mode the Vertex Color is not used and by default the 2D template uses Vertex Mode
2019-11-28 20:18:38 +01:00
0d2d79b8df GPencil: Make Vertex Color works in Vertex Mode
WIP: Need to disable Vertex Color in Material mode
2019-11-28 19:48:55 +01:00
7f997d8269 GPencil: Resorder List icons to be consistent
Now the icons are in the same order in Dopesheet, Layers and Material list
2019-11-28 19:36:01 +01:00
a401014938 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2019-11-28 19:05:49 +01:00
7c76fc12c5 GPencil: Group all icons after opacity 2019-11-28 18:56:40 +01:00
f22121c55f GPencil: Add emboss only to opacity 2019-11-28 18:53:08 +01:00
5a20f4bc58 GPencil: Enable Sliders by default in 2D template 2019-11-28 18:48:48 +01:00
e39283c043 GPencil: Remove Emboss por Sliders 2019-11-28 16:58:55 +01:00
fa042ba487 GPencil: Add N Panel in Dopesheet 2019-11-28 16:42:21 +01:00
6f437aab4f GPencil: Fix icon for mask layer in Dopesheet 2019-11-28 16:10:44 +01:00
104e9b8a4a GPencil: Add layer operators to Dopesheet Header 2019-11-28 14:39:04 +01:00
7ceabd7264 GPencil: Keep current Tool when reset all brushes 2019-11-28 10:24:35 +01:00
de8b59e6c9 Merge branch 'master' into greasepencil-object 2019-11-28 08:37:57 +01:00
d234d22650 GPencil: Simplify Reset All brushes code 2019-11-28 08:36:31 +01:00
da29260ab6 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2019-11-27 20:29:04 +01:00
cb9f4fecad GPencil: Check NULL Pointer 2019-11-27 20:25:31 +01:00
5e2df157ba GPencil: Only reset Brushes of the same tool 2019-11-27 20:23:15 +01:00
978052ca4e GPencil: Add Use Mask to Dopesheet 2019-11-27 20:15:45 +01:00
0c3219ac94 GPencil: Fix segment fault using Reset All
The tool was null and need to be sure the toolslot is right.
2019-11-27 19:57:14 +01:00
a80801f396 GPencil: Cleanup code 2019-11-27 17:09:24 +01:00
8b06f63e98 GPencil: Add small offset to sliders 2019-11-27 17:02:47 +01:00
9b0fffbc74 GPencil: Add Opacity y Onion switch to Dopesheet
These options are visible when enable Show Sliders.
2019-11-27 16:52:14 +01:00
48409b33d2 Merge branch 'master' into greasepencil-object 2019-11-27 11:31:54 +01:00
393e439ff3 GPencil: Add missing notifier when reset brushes 2019-11-27 11:21:11 +01:00
a58a68fa54 Revert "GPencil: Decrease user count when the material is unpinned"
This reverts commit d76d1b7d21.

My change was totally wrong. The user count was already handled.
2019-11-27 10:57:49 +01:00
d76d1b7d21 GPencil: Decrease user count when the material is unpinned 2019-11-27 10:54:43 +01:00
050276a1e6 GPencil: Reset Brushes from old versions
Sometimes old version brushes are damaged and must be removed when use Reset All
2019-11-27 10:49:39 +01:00
a09cc3ee1a GPencil: Cleanup pep8 2019-11-27 10:18:04 +01:00
38840adb17 Merge branch 'master' into greasepencil-object 2019-11-27 08:19:44 +01:00
9cd1c5edde GPencil: Delete unknow brushes when Reset All 2019-11-27 08:18:32 +01:00
af2de3cfd7 GPencil: Change default preset to use range by mode
In this way is easier to include new brushes by mode.
2019-11-27 08:18:09 +01:00
e72e0321b3 GPencil: Remove debug printf 2019-11-26 23:08:46 +01:00
155c85b431 GPencil: Fix error in Reset All Brushes 2019-11-26 20:20:51 +01:00
251e4f9975 GPencil: Fix number of users for Brushes 2019-11-26 20:02:43 +01:00
e013596735 GPencil: Fist changes to reset brushes in the right way 2019-11-26 19:59:20 +01:00
4f68e802fb GPencil: Use right operator for new brushes
The old operator was working by luck, but the gpencil settings were not set.
2019-11-26 19:55:19 +01:00
992cbb2b31 Merge branch 'master' into greasepencil-object 2019-11-26 19:48:06 +01:00
f5d453ceef Merge branch 'master' into greasepencil-object 2019-11-26 19:06:16 +01:00
74231d7457 GPencil: Fix error opening old files 2019-11-26 16:37:16 +01:00
af7b95ac9f Merge branch 'master' into greasepencil-object 2019-11-26 14:06:01 +01:00
d455141b0f Merge branch 'master' into greasepencil-object 2019-11-26 13:40:46 +01:00
37ed27d88e Merge branch 'master' into greasepencil-object 2019-11-25 16:13:09 +01:00
8075566030 Merge branch 'master' into greasepencil-object 2019-11-25 08:31:43 +01:00
8cce5aab0a Merge branch 'master' into greasepencil-object 2019-11-24 12:07:51 +01:00
dc6178d264 GPencil: Change Vertex Paint label 2019-11-23 16:53:34 +01:00
54910df67d GPencil: Cleanup more spaces 2019-11-23 13:11:12 +01:00
77222d0430 GPencil: Cleanup spaces 2019-11-23 13:05:22 +01:00
1cf5cc790e GPencil: Fix wrong versioning default struct name 2019-11-23 12:14:16 +01:00
d830b21d00 GPencil: Add missing initialization in previous commit 2019-11-23 11:53:03 +01:00
52722da166 GPencil: New Vertex Opacity factor by Layer
This allows to define the opacity factor for each layer.
2019-11-23 11:46:17 +01:00
d00da676bd Merge branch 'master' into greasepencil-object 2019-11-23 11:24:01 +01:00
e2fef7c4bd GPencil: Cleanup warnings 2019-11-23 11:23:24 +01:00
e55bd11acf GPencil: Remove use_cursor and replace by show_brush property
As now all are brushes, we don't need a special flag for grease pencil and we can resuse standard property of brushes.
2019-11-23 11:00:00 +01:00
c8ef6efc01 GPencil: Add Fallof menu to Tint tool 2019-11-22 23:51:18 +01:00
156bfaf83b GPencil: Set Smooth curve by default to Brushes 2019-11-22 23:42:15 +01:00
5d51439600 GPencil: Fix problem with Fallof curve for non Custom mode 2019-11-22 23:32:52 +01:00
b9a4bbd2ce GPencil: Remove Icon from Display panel 2019-11-22 23:09:19 +01:00
172812b40c GPencil: Tweaks to Display panel 2019-11-22 20:27:38 +01:00
725def6e8b GPencil: Show text buttons for direction in properties panel 2019-11-22 19:53:37 +01:00
f54431efe7 GPencil: Fix topbar popover for Fill tool 2019-11-22 19:40:37 +01:00
bfb5aaedc5 GPencil: Tweaks in Brush panels 2019-11-22 19:16:16 +01:00
ae483d62c8 Merge branch 'master' into greasepencil-object 2019-11-22 17:41:05 +01:00
7929e47e77 GPencil: More tweaks to UI panels 2019-11-22 17:38:22 +01:00
50a0db12a6 GPencil: Display two colors only for required Tools 2019-11-22 17:04:41 +01:00
bd2c3a6418 GPencil: Add Add/Sub Brush color to Display Panel 2019-11-22 16:50:58 +01:00
fca9b055a5 GPencil: Use Standard Falloff curves for Sculpt/Weight Paint
As the tools are bruhes, we can use the standard Curves.
2019-11-22 16:29:32 +01:00
fd795ee43e GPencil: Cleanup - Reorder Make list 2019-11-22 16:11:54 +01:00
7b6d21b24d GPencil: Rename Panel 2019-11-22 16:11:28 +01:00
8c272fa243 GPencil: Use Object name for Palette from Vertex Color 2019-11-22 11:17:07 +01:00
6f77846c68 GPencil: Use image name for palette extracted
Now the palette name is equals to image name.
2019-11-22 11:12:05 +01:00
86ffea5be9 Merge branch 'master' into greasepencil-object 2019-11-22 10:33:30 +01:00
fc3cf89a69 GPencil: Allow to hide cursor in Sculpt/Weight and Vertex mode 2019-11-22 10:32:27 +01:00
5aa63f2bd4 GPencil: Add icons for each type of Tool 2019-11-22 10:31:54 +01:00
37285e9050 GPencil: Remove old 2.7x Pie menus
These menus are not used anymore.
2019-11-22 10:00:00 +01:00
37d1906b8f GPencil: Fix missing Sculpt Strokes panel 2019-11-22 09:55:32 +01:00
1a5fa01eb3 GPencil: Add missing Strength Sculpt Brush 2019-11-21 23:05:23 +01:00
f0ec2db3d6 GPencil: Cleanup unused flags 2019-11-21 22:50:07 +01:00
f5c349f55c GPencil: Add missing Brush weight initialization 2019-11-21 22:43:10 +01:00
5c74c9c333 GPencil: Fix struct padding after merge 2019-11-21 22:35:33 +01:00
8687eda619 Merge branch 'master' into greasepencil-object
Conflicts:
	release/datafiles/locale
	release/scripts/addons
	release/scripts/addons_contrib
	source/blender/blenkernel/intern/scene.c
	source/blender/blenloader/intern/versioning_280.c
	source/blender/makesdna/DNA_brush_types.h
2019-11-21 22:28:01 +01:00
452b1a02e4 Gpencil: Convert Sculpt and Weight Paint to Brushes
This commit convert the old hacked brushes for Sculpt and Weight paint into real Blender brushes.

All hacks have been removed and the weight paint mode has been separated from sculpt code.

New keymaps by tool also.

Related to T71711
2019-11-21 22:18:10 +01:00
0a109b71ba Merge branch 'master' into greasepencil-object 2019-11-20 16:49:54 +01:00
a304f04604 GPencil: Add support to sort palette by SVH 2019-11-20 16:48:58 +01:00
c8d376a151 Merge branch 'master' into greasepencil-object 2019-11-19 23:04:18 +01:00
b7f72aecda GPencil: Replace wrong values in luminance
The code is disabled but want to keep the right formula.
2019-11-19 19:54:13 +01:00
56bdf8f9be GPencil: Change sort comparison function 2019-11-18 20:04:33 +01:00
5e804d1d17 GPencil: More tweaks to sort colors 2019-11-18 17:10:08 +01:00
1d79231f0f GPencil: Fix memory leak in Join Palettes 2019-11-18 16:26:15 +01:00
070391998f GPencil: Fix memory leak sorting palettes 2019-11-18 16:23:11 +01:00
fd79536845 GPencil: Invert Sort for Palette Value 2019-11-18 16:22:58 +01:00
7e63b20327 Merge branch 'master' into greasepencil-object 2019-11-18 14:34:39 +01:00
df55ed8288 GPencil: Add extract colors to Image menu 2019-11-18 11:19:59 +01:00
73b8ea5f2b GPencil: Fix Sort function 2019-11-18 10:40:05 +01:00
523d8f7bc5 GPencil: Add Sort button to Palette 2019-11-18 10:19:52 +01:00
e53e601322 GPencil: Add new buttons to move Up/Down colors in Palette 2019-11-18 10:19:31 +01:00
deefd7fb31 GPencil: Some tweaks to Sort and Join Palettes 2019-11-18 09:52:14 +01:00
5260161acb Merge branch 'master' into greasepencil-object 2019-11-17 22:55:42 +01:00
4e8de29546 GPencil: Fix Fill tint problems
When the stroke was already tinted, the color changes with the first click. Now the color is mixed.
2019-11-17 19:47:13 +01:00
2f877747bf Merge branch 'master' into greasepencil-object 2019-11-17 19:14:23 +01:00
e862abaf64 GPencil: Draw Edit Lines for 1 point strokes 2019-11-17 19:12:58 +01:00
489ed1fb6a GPencil: Fix error in Multiframe when select Lines only
The problem was the first stroke was set to true, but the first stroke was hidden, so the pointer was wrong for the active frame.
2019-11-17 18:08:06 +01:00
6290fd5821 GPencil: Fix duplicate parameter in UI: use line in multiframe 2019-11-17 16:34:31 +01:00
008ff3387f GPencil: Fix error converting Stencil Materials to Vertex Color 2019-11-17 16:28:31 +01:00
38aba90e7b GPencil: New operator to Join Palettes
Still need to define final Menu options and location.
2019-11-17 13:33:03 +01:00
48614ca42a GPencil: New operator to Sort Palette Colors
This is useful for sorting by Hue and Saturation any palette (not only used by Grease Pencil)
2019-11-17 12:13:21 +01:00
b5405cd285 GPencil: Reorganize palette operators 2019-11-17 11:33:20 +01:00
e652dcc476 GPencil: New operator to extract Palette from Image 2019-11-17 11:32:43 +01:00
660ff65c97 GPencil: Show line in Multiframe for Vertex Paint 2019-11-17 10:30:17 +01:00
35bb81656f GPencil: Fix error with Stencil Strokes when convert to Vertex 2019-11-16 20:50:41 +01:00
618a28368a GPencil: New operator to extract palettes from Images
Also more changes to sort colors, add a threshold , etc.
2019-11-16 20:19:25 +01:00
ca6425824f GPencil: reorganize menus for new Vertex operators 2019-11-16 16:51:50 +01:00
f5fb5aff00 GPencil: Fix typo 2019-11-16 16:51:34 +01:00
9ac5691b78 GPencil: Add option for Convert and Palette to selected only 2019-11-16 16:27:30 +01:00
cb1a0eb555 GPencil: Change default material names in conversion 2019-11-16 16:20:41 +01:00
d480d5793b GPencil: Add Merge and Convert to Material context menu 2019-11-16 16:20:10 +01:00
497903f392 GPencil: Create Palettes from Vertex Color 2019-11-16 16:11:27 +01:00
622391fafa Merge branch 'master' into greasepencil-object 2019-11-16 12:26:09 +01:00
9cf325200f Gpencil: Convert Materials to Vertex Color mode
Instead to use the materials to define colors, this convert the color to use Vertex Color and merge materials by type.

Textured strokes (not stencil mask) and fill not solid are not converted.
2019-11-16 12:24:34 +01:00
2528417229 Merge branch 'master' into greasepencil-object 2019-11-15 16:00:08 +01:00
49f15e9a42 GPencil: Change default palette name 2019-11-15 14:27:06 +01:00
8959703679 GPencil: Small cleanup in previous commit
Look for brush only once.
2019-11-15 10:55:45 +01:00
172cc30215 GPencil: Set default draw brush in all templates 2019-11-15 10:53:24 +01:00
09a03ce5db GPencil: Init defaults for all templates 2019-11-15 10:47:19 +01:00
97ff2295d7 Merge branch 'master' into greasepencil-object 2019-11-15 10:26:48 +01:00
e0ded3e8b4 Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/properties_data_modifier.py
	source/blender/gpencil_modifiers/MOD_gpencil_modifiertypes.h
	source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c
	source/blender/makesdna/DNA_gpencil_modifier_types.h
	source/blender/makesrna/intern/rna_gpencil_modifier.c
2019-11-14 19:40:16 +01:00
e03ebc88ca GPencil: Add new parameters to merge materials
Now the user can control de Hue, Saturation and Value range.
2019-11-14 16:16:29 +01:00
26933c4700 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_defaults.c
2019-11-14 12:38:21 +01:00
c832eb9c98 GPencil: Fix default vertex color
This error was introduced when fix the double default brushes.
2019-11-13 19:28:35 +01:00
ecccfff721 Merge branch 'master' into greasepencil-object 2019-11-13 17:21:47 +01:00
946985af92 Merge branch 'master' into greasepencil-object 2019-11-13 08:55:05 +01:00
051aca8844 GPencil: Add support to Vertex Paint for Eyedropper tool 2019-11-12 22:13:42 +01:00
c0b5817066 GPencil: Add small color box to context menu 2019-11-12 18:45:02 +01:00
dcdf548e54 GPencil: Fix double Brush initialization 2019-11-12 17:31:41 +01:00
ca12d75821 GPencil: Hide Edit lines in Vertex Paint mode 2019-11-12 17:15:50 +01:00
117b284f8a GPencil: New Set Vertex Color operator 2019-11-12 16:59:34 +01:00
827b5f48fa Merge branch 'master' into greasepencil-object 2019-11-12 16:33:55 +01:00
bd89367bd2 GPencil: New parameter for Vertex Paint mix
Also some cleanup.
2019-11-12 16:32:31 +01:00
5e4d6aee04 GPencil: Show Vertices in Vertex Paint always 2019-11-12 16:01:58 +01:00
62b527581a GPencil : Use different color for selected point sin Vertex Paint 2019-11-12 15:02:32 +01:00
84da2e2b54 GPencil: Show Vertex Opacity in Overlay for Vertex Paint 2019-11-12 15:01:58 +01:00
1942e1e27a GPencil: Move move below color wheel in context menu 2019-11-12 10:02:28 +01:00
6bc2e906ec GPencil: New operators for Vertex Paint
* Levels
* Invert
* Hue Saturation Value
* Bright/Contrast
2019-11-11 23:21:28 +01:00
37429691b5 GPencil: Show Edit points in Vertex Paint
Also added the option to hide edit points when disable Overlays in any mode.
2019-11-11 19:56:29 +01:00
a481be64cf GPencil: Remove Flip colors in Context menus 2019-11-11 19:42:59 +01:00
8acb506104 GPencil: Add color wheel to Draw mode context menu 2019-11-11 19:28:39 +01:00
e133343e71 GPencil: New menu Select in Vertex Paint mode 2019-11-11 19:15:27 +01:00
356ffdcc06 GPencil: New context menu for Vertex Mode 2019-11-11 19:05:33 +01:00
46b03f203d Merge branch 'master' into greasepencil-object 2019-11-11 17:41:03 +01:00
8c3d9c436c GPencil: Replaces how Select Color works.
Now only checks the Hue of the color to get all ranges of saturations.
2019-11-11 17:40:09 +01:00
3169640033 GPencil: Add a distance fallof to Smear tool
Calc distance from initial sample location and add a fallof effect
2019-11-11 16:54:41 +01:00
ed21ed3030 GPencil: Rename Transform UV to Transform Fill
This affects to reset_uv also.
2019-11-11 16:22:29 +01:00
8c32161c78 GPencil: Fix segment fault in Blur brush 2019-11-11 16:12:04 +01:00
486b0e04e6 GPencil: Fix Vertex Paint brush does not paint in center
The brush curve factor was inverted.
2019-11-11 15:52:40 +01:00
3b3ee4091b GPencil: Cleanup variable type 2019-11-11 11:29:55 +01:00
97d5085061 GPencil: Check grid cell index range
It could get wrong values in corner case situations.
2019-11-11 10:30:12 +01:00
c553e5d113 Merge branch 'master' into greasepencil-object 2019-11-11 10:18:35 +01:00
a283aa9505 GPencil: Redesign Vetex Paint Smear Tool
Now instead to rorate the grid, the point is extracted using the direction and not the cell above in a rotated grid. This simplifies the process and gets better results.
2019-11-11 10:17:59 +01:00
50017dcfcb GPencil: First steps for the new Smear tool
Note: Still not working.
2019-11-10 17:39:37 +01:00
089be921c1 Merge branch 'master' into greasepencil-object 2019-11-10 09:11:45 +01:00
8da22e5293 GPencil: New Blur Tool for Vertex Paint 2019-11-09 17:45:49 +01:00
e603f05b69 GPencil: Add curve falloff for Vertex Paint brushes 2019-11-09 16:15:06 +01:00
d13ed6391c GPencil: Cleanup comment 2019-11-09 13:49:46 +01:00
ea33022983 GPencil: New Vertex Paint Average Brush
This brush tint the points with the average of the colors below the cursor.
2019-11-09 13:45:41 +01:00
521358428d GPencil: Attenuate translate effect in Transform UV operator
The old attenuate value makes the transform too hard.
2019-11-09 12:28:26 +01:00
9c816eec26 GPencil: Initialize Brush only if the brush is new 2019-11-09 12:09:42 +01:00
2ab1485cb5 GPencil: New Select by Color operator 2019-11-09 11:53:12 +01:00
064f132000 GPencil: New Vertex Paint Replace Tool
This tool replaces the old mixed color with the current one, but keeps the same mix factor. This is not possible with Draw tool, because the draw tool replaces the mix factor.

With this tool is very easy tint previous colors, but keeping the same mix and pressure values to maintain the same artistic look and feel.
2019-11-09 11:01:27 +01:00
b60b92abd4 GPencil: Display Fill colors in Vertex Paint in Multiedit always
Don't use the option of multiedit "use_gpencil_multiedit_line_only"
2019-11-09 09:04:12 +01:00
c51d160ab5 GPencil: Fix origin of UV rotation using object location 2019-11-08 20:52:58 +01:00
6cddb446da Cleanup: Remove old commented lines 2019-11-08 20:34:53 +01:00
f0b5d47802 GPencil: Remove data from temp struct
These variables are not used now.
2019-11-08 20:14:15 +01:00
4449f8f8db GPencil: Review comments, remove unused code and make safe free memory 2019-11-08 20:08:46 +01:00
f99acbe54b Cleanup: More unused variables 2019-11-08 20:02:40 +01:00
d4ea8697f6 Cleanup: Remove unused variables 2019-11-08 20:00:31 +01:00
bfa94bfeee Cleanup: Fix typo error 2019-11-08 19:48:59 +01:00
0b3df9561d GPencil: Use an array to select Vertex Paint points
This is required for new brushes that need to have all points selected before applying the effect
2019-11-08 19:47:32 +01:00
9c5e02d1d3 GPencil: Rename Tint to Vertex Paint 2019-11-08 18:28:21 +01:00
900100e859 Merge branch 'master' into greasepencil-object 2019-11-08 17:09:59 +01:00
d3d1eee154 GPencil: Add multiframe support to Vertex Paint 2019-11-08 17:08:12 +01:00
5e4517819c GPencil: Don't check mask in Draw mode
Also some code cleanup
2019-11-08 16:51:01 +01:00
ea28ccc885 GPencil: Fix poll for all select tools in Vertex Paint 2019-11-08 11:46:15 +01:00
6e5ed5c89e GPencil: Reformat RNA code to extend selection in all modes 2019-11-08 11:43:07 +01:00
4cab8c06f8 GPencil: Fix error in Circle select for Vertex Paint 2019-11-08 11:21:39 +01:00
32efa6a16a GPencil: Attenuate colors when use mask in Vertex Paint 2019-11-08 11:21:19 +01:00
e2199b1673 Merge branch 'master' into greasepencil-object 2019-11-08 08:47:35 +01:00
4c5eebadae GPencil: Fix Box Selection Tool keymaps 2019-11-07 23:36:35 +01:00
5fc3ee0b92 GPencil: Use Mask in Vertex Paint operator 2019-11-07 23:13:13 +01:00
9bba2b729c GPencil: Fix error in versioning for old files 2019-11-07 23:06:58 +01:00
fcdb07c569 GPencil: Display Edit Points in Vertex Paint and Mask buttons
This is part of the masking functions.
2019-11-07 22:58:17 +01:00
f6931dd946 GPencil: Remove Draw menu in Vertex Paint mode 2019-11-07 22:26:54 +01:00
fcfdfc180a GPencil: Add mask options for Vertex Paint
Still not working, only defined the UI elements.
2019-11-07 22:24:26 +01:00
114d44ac4b GPencil: Move Vertex Mode to Brush 2019-11-07 20:43:22 +01:00
9ebb587791 GPencil: Fix versioning for Vertex Paint 2019-11-07 20:12:45 +01:00
0688f32812 GPencil: Remove Snap menu in Vertex Paint mode 2019-11-07 19:58:32 +01:00
3d28d648e4 GPencil: Put Vertex Paint mode before Weight Paint mode
This is to keep UI consistency.
2019-11-07 19:56:22 +01:00
92cdf9ad29 GPencil: Move Boundary parameter to popover
The topbar is too populate.
2019-11-07 19:54:17 +01:00
cc3019600c GPencil: Use Vertex Color in Fill Tool 2019-11-07 19:40:49 +01:00
e05ecbe519 GPencil: Use Brush color for Tint tool cursor 2019-11-07 19:25:47 +01:00
d33be9025f GPencil: Use Brush size for cursor in Vertex Paint mode 2019-11-07 19:24:16 +01:00
c3d8ca1290 GPencil: Fix Palette panels for Vertex Paint 2019-11-07 19:13:33 +01:00
a09b824642 Merge branch 'master' into greasepencil-object 2019-11-07 18:06:22 +01:00
d7fed89b21 GPencil: Use right Paint for Vertex Paint mode 2019-11-07 18:05:47 +01:00
bb48f177d9 GPencil: Fix default palette for Vertex Paint mode 2019-11-07 18:00:17 +01:00
52c9b6cdad GPencil: Basic Vertex Color mode working
Still pending panels and tools
2019-11-07 18:00:11 +01:00
c1168f9ef1 GPencil: More Keymap changes for Vertex Color 2019-11-07 18:00:05 +01:00
2df4db3ac6 GPencil: Fix brush icons 2019-11-07 18:00:00 +01:00
74d293d7ad GPencil: Solve problem with Keymap missing 2019-11-07 17:59:54 +01:00
6a5fa02cb9 GPencil: Add versioning code for new tool 2019-11-07 17:59:44 +01:00
4eb7027c64 GPencil: More changes to keymaps and tools 2019-11-07 17:59:38 +01:00
e226e0df50 GPencil: First steps to create a new Vertex Mode 2019-11-07 17:59:32 +01:00
add7b723bb Merge branch 'master' into greasepencil-object 2019-11-06 17:44:40 +01:00
7006ecf946 GPencil: Use Ellipsoid to determine Vertex Color tint
Now, the scale of the object is used to detrmine the final size of the radius using an ellipsoid.
2019-11-06 17:11:49 +01:00
203fcf7014 GPencil: Fix strength error in Tint Tool
The value must not be clamped.
2019-11-06 16:18:38 +01:00
d9cced733e Merge branch 'master' into greasepencil-object 2019-11-06 08:49:28 +01:00
e76de93f2e GPencil: Use parent matrix in Vertex Color modifier 2019-11-06 08:48:09 +01:00
c17b4b7f67 GPencil: Fix if mistake in previous commit 2019-11-05 20:01:36 +01:00
8239b07a53 GPencil: Use decay color in modifier 2019-11-05 19:51:45 +01:00
78e7a6ef13 GPencil: Fix problems with the vertex color modifier 2019-11-05 19:51:45 +01:00
50de645ed5 GPencil: Basic functionality of Vertex Color modifier 2019-11-05 19:51:45 +01:00
c79b00ad39 GPencil: More preparation of the Vertexcolor modifier 2019-11-05 19:51:45 +01:00
99c01fa330 GPencil: Basic structure of the new Vertex Color modifier
Still not working, only put in place all parts.
2019-11-05 19:51:45 +01:00
56fa4f6e17 Gpencil: Add mix_color interpolation to sample function. 2019-11-05 23:03:56 +08:00
711563594a GPencil: Use Vertex Color in Hue/Saturation modifier 2019-11-05 15:38:45 +01:00
621e3d46c1 GPencil: Use Vertex Color in Tint modifier 2019-11-05 15:34:58 +01:00
afbf41231c GPencil: Fix Title for Mix Factor
The text is inside the value if put the parameter in the same row and we want the text before value.
2019-11-05 14:22:00 +01:00
ef0ed19c3b GPencil: Fix RNA subtype error 2019-11-05 14:08:59 +01:00
41bd3c185b GPencil: Apply Layer Tint to Vertex Color 2019-11-05 11:04:42 +01:00
2fad49293c Merge branch 'master' into greasepencil-object 2019-11-05 10:41:20 +01:00
b09c5b8e86 GPencil: Tweaks to Vertex Panels 2019-11-05 10:40:36 +01:00
4029e72e58 GPencil: Use standard checkbox for Vertex properties panel 2019-11-05 10:10:31 +01:00
f6a67e3460 GPencil: Add Vertex Color to N Panel 2019-11-04 23:05:49 +01:00
a474bd865d GPencil: Add a switch to Vertex Color panels 2019-11-04 22:53:40 +01:00
e317484d00 GPencil: Replace default palette to Krita colors 2019-11-04 20:15:40 +01:00
dfc088fb57 GPencil: Exchange default colors for Tint and Draw 2019-11-04 19:29:52 +01:00
0b979ae46f GPencil: Reduce Palette popover width 2019-11-04 19:12:21 +01:00
8e14252df7 GPencil: Move default palette code to BKE 2019-11-04 19:02:48 +01:00
74f1cf3183 GPencil: Move variables in struct
Also this solves some alignment errors
2019-11-04 18:44:20 +01:00
1243aec8bc GPencil: Cleanup 2019-11-04 18:05:36 +01:00
15ea17b5db Merge branch 'master' into greasepencil-object 2019-11-04 17:50:37 +01:00
80be882666 GPencil: Add a default Palette 2019-11-04 17:49:15 +01:00
10eaa2834c GPencil: Apply Vertex Color to Fill areas 2019-11-04 16:59:19 +01:00
63eb3920d0 GPencil: Use Vertex Color for Fill areas in Draw tools 2019-11-04 16:25:00 +01:00
932375336f GPencil: Initialize Weight Paint data 2019-11-04 16:08:33 +01:00
5693cd9342 GPencil: Replace default Red by Violet color 2019-11-04 16:01:13 +01:00
fe21321644 GPencil: Use Icon like Dyntopo for Vertex Color 2019-11-04 16:00:04 +01:00
993b27b89f GPencil: Change default Tint and Vertex Color 2019-11-04 15:54:58 +01:00
8ee9cf9e7c GPencil: Set Tin tool Strength to 0.8 by default 2019-11-04 14:34:01 +01:00
56bae9ec3e GPencil: Use Fill Vertex Color mix in Fill 2019-11-04 11:03:47 +01:00
518db25122 GPencil: Use Stroke Vertex mode in Tint tool 2019-11-04 10:52:19 +01:00
9a727aefe1 GPencil: Use Stroke Vertex switch in paint and primitive tools 2019-11-04 10:46:59 +01:00
f55145c03a Merge branch 'master' into greasepencil-object 2019-11-04 10:31:38 +01:00
f69106f683 GPencil: New option to define if vertex color affect to Stroke and/or Fill
This commit only adds the parameters, but is not using them.
2019-11-04 10:30:58 +01:00
bf7e134a5b GPencil: Add a switch to enable Vertex Color
This is similar to Dynotopo, you can enable it or not.
2019-11-03 23:30:42 +01:00
e278b3fc42 GPencil: Add "Base" to Stroke and Fill color label 2019-11-03 22:51:37 +01:00
481de5a5c8 GPencil: Join Color and Vertex Color popover in UI 2019-11-03 20:39:31 +01:00
e26bd6e659 GPencil: More UI tweaks to Vertex Color panels 2019-11-03 20:33:31 +01:00
7c9c0d442f GPencil: Hide colorwheel in topbar 2019-11-03 20:14:04 +01:00
8610d6e9ce GPencil: Move Palettes to Subpanel 2019-11-03 19:47:03 +01:00
8146acd524 GPencil: Fix inverted color in Tint tool 2019-11-03 19:37:50 +01:00
9a2038d031 GPencil: Remove TOPBAR_PT_gpencil_vertexcolor
Only use the color and the menu Vertex Color
2019-11-03 19:33:40 +01:00
e75926277e Cleanup: Remove extra line 2019-11-03 19:26:40 +01:00
e826312d84 GPencil: Set Vertex Factor to 1 and invert default colors 2019-11-03 15:58:46 +01:00
e44b643450 Merge branch 'master' into greasepencil-object 2019-11-03 11:27:16 +01:00
5aee15c2c0 GPencil: Reorganize Vertex Color UI moving to Popover 2019-11-03 11:26:33 +01:00
27a7f4bf43 GPencil: Change materials defaults for 2D template 2019-11-03 10:56:34 +01:00
0349e82d8b GPencil: Rename "Vertex Factor" to "Vertex Color Factor" 2019-11-03 08:56:47 +01:00
3b29a921fb GPencil: Split Vertex Paint factor for Draw
This allows to use palettes.
2019-11-02 22:06:44 +01:00
5bbe385a9e GPencil: Replace duplicate brush preset code by function 2019-11-02 20:44:15 +01:00
54bc7901d5 Cleanup: Compiler warnings 2019-11-02 20:33:11 +01:00
ea367d7cb1 GPencil: Replace Mix Color by Vertex Color in UI 2019-11-02 20:30:31 +01:00
e27bcc4318 GPencil: Create default Tint brush for old files 2019-11-02 20:21:45 +01:00
52349f5d3d GPencil: Reduce attenuate factor 2019-11-02 17:23:30 +01:00
7c4fc7066f GPencil: Improve color blending in Tint 2019-11-02 17:17:14 +01:00
017d36b557 GPencil: More work to make Tint operator 2019-11-02 16:56:37 +01:00
27efbf447f GPencil: Basic structure for Tint Tool
Still not working, but all pieces put in place.
2019-11-02 14:08:28 +01:00
81d1840d7c GPencil: Fisrt steps to create new Tint Brush type 2019-11-02 12:20:31 +01:00
2e263fa91f Merge branch 'master' into greasepencil-object 2019-11-02 11:51:46 +01:00
7c3139f340 Merge branch 'master' into greasepencil-object 2019-11-02 11:14:46 +01:00
e31a5fa567 Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/addons
	source/blender/editors/gpencil/gpencil_paint.c
2019-11-02 10:34:02 +01:00
4235fcce38 GPencil: Hide mix color in Topbar depending of material type 2019-11-01 20:13:53 +01:00
564b5a3549 GPencil: Remove side Mix Color panel for Texture materials 2019-11-01 20:06:04 +01:00
55e261a98e GPencil: Move to panel the Mix Color again 2019-11-01 19:53:39 +01:00
da43fde938 Revert "GPencil: Move mix color to top of he panel"
This reverts commit 9a252b5f50.
2019-11-01 19:50:09 +01:00
9a252b5f50 GPencil: Move mix color to top of he panel 2019-11-01 19:46:01 +01:00
8cbd52a27c GPencil: New Color Mix panel 2019-11-01 16:54:04 +01:00
e5ed4d53c0 GPencil: Fix compiler warnings 2019-11-01 16:19:44 +01:00
bd16d0d7fb Merge branch 'master' into greasepencil-object 2019-11-01 10:56:38 +01:00
af2263d5be GPencil: Add missing prop Update 2019-10-31 19:23:00 +01:00
d7b3d5c427 GPencil: Set Active Smooth to 0.35
With new design of sampling, the old value was too high.
2019-10-31 17:52:26 +01:00
09305099d0 GPencil: Double Random Pressure effect 2019-10-31 17:47:14 +01:00
c91336d9a3 GPencil: Remove Smooth Thickness and Randomness
These parameters are not needed with the new functions.
2019-10-31 17:40:29 +01:00
e28caf3073 Merge branch 'master' into greasepencil-object 2019-10-31 17:02:47 +01:00
63797f217c GPencil: Add Mix color to paint operators 2019-10-31 16:52:42 +01:00
253c05638a GPencil: Use new mix_color variable in functions
Still more changes pending.
2019-10-31 16:52:35 +01:00
2b6f8aaf68 GPencil: Add new variables for mix color
This will be used by Vertex Paint tools.
2019-10-31 16:52:26 +01:00
9887439349 Merge branch 'master' into greasepencil-object 2019-10-31 12:27:19 +01:00
a99e1afae0 GPencil: Add merge materials to Cleanup menu 2019-10-30 22:55:10 +01:00
b9dc338f0e GPencil: Basic Merge Material Stroke operator
Still needs more work on merge algorithm, but at least this is the basic structure.
2019-10-30 22:55:03 +01:00
7c44bfe7a8 Merge branch 'master' into greasepencil-object 2019-10-30 22:43:21 +01:00
9596fb577d Merge branch 'master' into greasepencil-object 2019-10-30 15:53:06 +01:00
da3928312a Gpencil: Add BKE_gpencil_add_stroke_existing_style() function.
This additionally copies the temp drawing color fields in gps->runtime.
So that when adding new strokes in the modifier the style is preserved.
2019-10-30 20:01:56 +08:00
d6b0c0329e Merge branch 'master' into greasepencil-object 2019-10-30 11:12:04 +01:00
8b7e3cc9b5 Merge branch 'master' into greasepencil-object 2019-10-29 17:24:47 +01:00
d12e7e4e08 Merge branch 'master' into greasepencil-object 2019-10-28 16:39:12 +01:00
562679bb0f Merge branch 'master' into greasepencil-object 2019-10-28 11:05:36 +01:00
3e840e9a02 Merge branch 'master' into greasepencil-object 2019-10-27 19:50:02 +01:00
231fd37a3e Merge branch 'master' into greasepencil-object 2019-10-27 10:06:19 +01:00
67ec16ff2d Merge branch 'master' into greasepencil-object 2019-10-25 16:46:25 +02:00
7394daf4b3 Merge branch 'master' into greasepencil-object 2019-10-24 13:49:25 +02:00
70a921237d Merge branch 'master' into greasepencil-object 2019-10-23 17:51:14 +02:00
39b9131a39 Merge branch 'master' into greasepencil-object 2019-10-22 11:24:42 +02:00
5293d87161 Merge branch 'master' into greasepencil-object 2019-10-21 20:08:14 +02:00
eed6ee0c15 Merge branch 'master' into greasepencil-object 2019-10-21 10:53:06 +02:00
36fc327005 Merge branch 'master' into greasepencil-object 2019-10-20 16:03:48 +02:00
d0d35e0fd4 Fix merge issue in gpencil_primitive.c 2019-10-20 10:45:43 +01:00
6a06dac6c3 Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/presets/keyconfig/keymap_data/blender_default.py
	source/blender/editors/gpencil/gpencil_primitive.c
2019-10-19 17:02:09 +02:00
694623e3fd Merge branch 'master' into greasepencil-object 2019-10-19 10:02:10 +02:00
125bd83d6a GPencil: Fix compiler error
The icon must be added only when the icon is cretaed or the make fails.
2019-10-18 15:46:31 +02:00
610e1d1b1f Merge branch 'master' into greasepencil-object 2019-10-18 14:35:01 +02:00
84a9e2836c GPencil: Primitive: Polyline tool 2019-10-18 10:32:28 +01:00
2194d63c87 Merge branch 'master' into greasepencil-object 2019-10-18 10:25:27 +02:00
64b1b68a6a Merge branch 'master' into greasepencil-object 2019-10-17 17:30:27 +02:00
b580fdf0fe GPencil: remove code from Polygon mode from Freehand operator
This section of the code was from 2.7x and it's was not working and it will be replaced by a new primitive polyline tool.
2019-10-17 17:29:46 +02:00
f2aa4d9028 GPencil: Guides: Fix guides to work when using lazy mode
This now snaps the lazy mode output to the guides if they are enabled.
2019-10-17 14:48:50 +01:00
afe376d075 GPencil: Cleanup: remove unused variable 2019-10-17 13:47:35 +01:00
791bf43218 GPencil: Cleanup gpencil_add_guide_points function 2019-10-17 13:41:57 +01:00
33ea84f629 GPencil: Guides: Use angle sampling for Circular guide
Use angle sampling for missing points, this fixes fast stroke issues finally.
2019-10-17 13:20:43 +01:00
e30cf8a92f GPencil: Guides: Improve fake point sampling for Circular guides
This provides better spacing and improves fast strokes
2019-10-17 12:00:59 +01:00
96935969c5 GPencil: Guides: Fixed issue with start of very fast strokes
The interpolation now runs from the very first point.
2019-10-17 10:47:09 +01:00
15f6c71382 Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object 2019-10-17 10:31:14 +01:00
ef07bfbe29 GPencil: Fix guides after recent refactor
There is still an issue with the start of very fast strokes that needs solving.
2019-10-17 10:29:55 +01:00
a0e8ef1e31 Merge branch 'master' into greasepencil-object 2019-10-17 11:21:11 +02:00
71a7ef06ea Merge branch 'master' into greasepencil-object 2019-10-16 22:00:27 +02:00
601041794a GPencil: Don't apply smooth to position for guides 2019-10-16 18:33:59 +02:00
244667bff1 GPencil: Disable Arc fake points for guides
WIP: Need points for fast circles.
2019-10-16 18:07:29 +02:00
750eab8064 Merge branch 'master' into greasepencil-object 2019-10-16 16:40:36 +02:00
5e827607a8 GPencil: Remove Smart Smooth Brush parameter
This parameter is not required because a value of 0.15 is working fine in any OS (this parameter was added to UI to make test of different values).
2019-10-16 16:32:24 +02:00
b5329c4eb4 Merge branch 'master' into greasepencil-object 2019-10-16 10:34:22 +02:00
85c17ecae2 Merge branch 'master' into greasepencil-object 2019-10-15 16:43:27 +02:00
f499ec4964 GPencil: Don't calculate arc if the angle is too sharp
This occurs when the stroke change of direction abruptly.
2019-10-15 15:50:22 +02:00
13736b3f9f GPencil: More tweaks to brush settings 2019-10-15 14:04:47 +02:00
4a79cb53d7 GPencil: Don't generate fake point when using Stabilize mode
This mode is not compatible with fake points.
2019-10-15 13:18:32 +02:00
3d769f0e1b Merge branch 'master' into greasepencil-object 2019-10-15 12:48:43 +02:00
45bc21e7e2 GPencil: Redesign input samples management
Now, instead to generate fake events in a linear interpolation and try to smooth the line later, an arc is created between the points and try to reproduce the ballistic trajectory of the mouse/pen. This gets better results and especially when the mouse moves very fast getting a more organic result.

Also, the input samples maximum has been changed to 15.

Note: Still we need to test DOT materials to define if the samples are getting good result of we must make more dense the number of points for these materials.
2019-10-15 12:47:35 +02:00
a98369e6a6 GPencil: More tweaks to arc function 2019-10-14 17:07:02 +02:00
34da576bea GPencil: Fix error in previous commit with interpolate factor 2019-10-14 16:26:11 +02:00
e08c6dd293 Merge branch 'master' into greasepencil-object 2019-10-14 15:58:27 +02:00
22bd2be24e GPencil: Interpolate pressure and strength for arc points 2019-10-14 15:39:29 +02:00
e78cd7a417 GPencil: Add new ARC points for missing mouse events (WIP)
See T70765 for details
2019-10-14 13:44:55 +02:00
0bfa730db0 Merge branch 'master' into greasepencil-object 2019-10-14 09:04:29 +02:00
aa5084202d Merge branch 'master' into greasepencil-object 2019-10-11 19:59:01 +02:00
da8e276b28 Merge branch 'master' into greasepencil-object 2019-10-11 13:46:06 +02:00
7f8f29448e Merge branch 'master' into greasepencil-object 2019-10-10 20:21:50 +02:00
195cd35e2d Merge branch 'master' into greasepencil-object 2019-10-10 08:14:12 +02:00
97bb07f07a Merge branch 'master' into greasepencil-object 2019-10-09 09:06:51 +02:00
a0da32f9cd Merge branch 'master' into greasepencil-object 2019-10-07 20:41:02 +02:00
6ed8d5e281 Merge branch 'master' into greasepencil-object 2019-10-06 12:07:02 +02:00
5ed2189961 Merge branch 'master' into greasepencil-object 2019-10-04 21:00:25 +02:00
fc019244c8 Merge branch 'master' into greasepencil-object 2019-10-04 10:22:03 +02:00
3a557c32a9 Merge branch 'master' into greasepencil-object 2019-10-03 19:04:09 +02:00
0a033c4b69 GPencil: Disable Smart Smooth when Random is enabled
These options cannot be used at the same time because the Smart Smooth is designed to remove any imperfection in the stroke and the random options are designed to create these imperfections, so the smooth removes all randomnes.
2019-10-03 17:46:21 +02:00
6109704d58 Cleanup: Fix comments 2019-10-03 16:56:55 +02:00
6a0153590c Merge branch 'master' into greasepencil-object 2019-10-03 16:52:58 +02:00
0bb31c08b5 GPencil: Sculpt brushes uses affect position flag
This commit changes the following:

1) The affect parameters have been moved to brush. Before, this parameter was by toolsettings and this was wrong.
2) Intialize the affect postion to ON.
3) If affect position is OFF, don't apply Sculpt brush effect.
2019-10-03 16:25:58 +02:00
8571a28c6e Merge branch 'master' into greasepencil-object 2019-10-03 12:56:28 +02:00
adebd9813b GPencil: Limit internally Smart Smooth to range 0 to 0.5
In the UI we keep a range between 0.0 to 1.0 for usability reasons, but internally, the value is divided by 2 to limit the real between 0.0 and to 0.5 and also makes it less sensible.
2019-10-03 12:54:46 +02:00
dd9995e985 GPencil: Remove Active Subdivide parameter from Brush
This parameter is not required with the last changes in paint smooth.
2019-10-03 12:48:07 +02:00
f895c8f9fd GPencil: Use original strokes, not evaluated 2019-10-02 23:16:11 +02:00
2923b1feb9 GPencil: Fix wrong break line
This was kept in the code by error.
2019-10-02 16:27:49 +02:00
61ac5e5421 GPencil: Change default value for Scale change 2019-10-02 16:10:14 +02:00
d69c6b6f47 GPencil: Add missing stroke UV initialization. 2019-10-02 16:09:02 +02:00
9547085767 Merge branch 'temp-gpencil-uv' into greasepencil-object 2019-10-02 15:41:43 +02:00
e9dd688347 GPencil: Set Reset UV menu as one option only 2019-10-02 15:40:28 +02:00
f6c786102c Merge branch 'master' into greasepencil-object 2019-10-02 15:33:53 +02:00
ba9ac200ce GPencil: Rename Clear transform to Reset 2019-10-02 15:26:20 +02:00
f6de7a2314 GPencil: Fix memory leak
The return was breaking the memory free.
2019-10-02 11:19:09 +02:00
184006ed18 GPencil: Fix typo error 2019-10-02 11:11:08 +02:00
a49d8223a4 Merge branch 'master' into temp-gpencil-uv 2019-10-02 11:09:03 +02:00
26b3b64156 Merge branch 'master' into greasepencil-object 2019-10-02 11:07:12 +02:00
43f53078a2 GPencil: New operator to clear UV transformations 2019-10-02 11:04:14 +02:00
5829b32692 GPencil: Fix error of initialization 2019-10-01 22:54:22 +02:00
0e91daac6d GPencil: Set all tools in one Toolbar Icon 2019-10-01 20:15:22 +02:00
353244e52b GPencil: Improve messages 2019-10-01 20:15:22 +02:00
a4a7073f6c GPencil: New Tools for transforming UVs
The new tools are for translate, rotate and scale the UVs for any fill stroke using texture.

This was a missing option for UVs in grease pencil.
2019-10-01 15:32:54 +02:00
3da3883fc5 Merge branch 'master' into greasepencil-object 2019-10-01 15:29:37 +02:00
ea58426aa1 Merge branch 'master' into greasepencil-object 2019-09-30 10:35:36 +02:00
1e791f038b Merge branch 'master' into greasepencil-object 2019-09-29 20:05:52 +02:00
9f2048cd08 Cleanup: Remove wrong format 2019-09-27 23:41:32 +02:00
cabd3c9fba GPencil: Fix merge errors 2019-09-27 23:36:40 +02:00
0981884610 GPencil: SVG Remove exporter
This will be added in the future.
2019-09-27 23:34:29 +02:00
b5b414b562 Cleanup: Unused variables 2019-09-27 23:32:35 +02:00
623b7334dc Cleanup: Clang Format 2019-09-27 23:29:17 +02:00
cfef9632b6 GPencil: Remove unused functions
These functions were moved to a separated patch for modifiers: https://developer.blender.org/D5795
2019-09-27 23:21:07 +02:00
b75d07bf45 Merge branch 'master' into greasepencil-object 2019-09-27 23:16:49 +02:00
4c723d6c80 Merge branch 'master' into greasepencil-object 2019-09-27 22:59:21 +02:00
419157e3c5 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/brush.c
2019-09-27 16:56:07 +02:00
a5c1926a82 Merge branch 'master' into greasepencil-object 2019-09-27 15:31:20 +02:00
f4d9050eac Merge branch 'master' into greasepencil-object 2019-09-27 09:56:44 +02:00
9cf21e714a GPencil: Test new Smart Smooth parameter in UI 2019-09-26 23:29:30 +02:00
ce3d8cee4b Merge branch 'master' into greasepencil-object 2019-09-26 18:43:17 +02:00
27f8dd7242 GPencil: Change smooth loops to 5 2019-09-26 16:35:15 +02:00
8de1e8b5fe Cleanup: Fix comments typo 2019-09-26 16:35:08 +02:00
1f99309561 Merge branch 'master' into greasepencil-object 2019-09-26 16:04:07 +02:00
64f5b1d986 GPencil: Add smart smooth for interpolated points
When using the samples, the interpolated points get abrupt steps because the system cannot receive all events in a short period of time.

This is more noticeable when the samples are set to 10 and the pen is moved very fast. The problem with post-processing smooth is that is applied to all stroke and this removes details.

The smart smooth is automatic and detect only the segments in the stroke where the system was unable to capture all movements and apply a smooth algorithm.
2019-09-26 15:59:34 +02:00
3d67dd939f Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_paint.c
2019-09-25 16:18:07 +02:00
b1650a910e Clenaup: Fix typo error 2019-09-25 10:18:23 +02:00
4993a15498 GPenciL: Reduce lower limit for minimum pressure. 2019-09-25 10:15:39 +02:00
990019de56 GPencil: Add smooth in interpolated strokes 2019-09-25 09:42:59 +02:00
ce3b35de28 GPencil: Apply active smooth to Strength 2019-09-24 19:42:46 +02:00
8b584b3c16 GPencil: Truncate last stroke buffer points with very low pressure
This reduces the drag line when move very fast the pen.
2019-09-24 19:42:39 +02:00
99a2682b07 Merge branch 'master' into greasepencil-object 2019-09-24 19:42:29 +02:00
8d681eccf0 Merge branch 'master' into greasepencil-object 2019-09-24 10:37:20 +02:00
b77f87da5e Merge branch 'master' into greasepencil-object 2019-09-23 17:04:15 +02:00
33a9976637 Merge branch 'master' into greasepencil-object 2019-09-23 11:53:33 +02:00
7c45b87ec7 Merge branch 'master' into greasepencil-object 2019-09-22 13:16:40 +02:00
2ed03e831d Merge branch 'master' into greasepencil-object 2019-09-21 19:56:03 +02:00
0513f4e6ce Merge branch 'master' into greasepencil-object 2019-09-21 10:41:17 +02:00
47851e38e7 GPencil: Use Object location instead of 3D cursor for Grab Brush
Instead to use the 3D cursor as reference point (legacy code), it would be better use the object location.
2019-09-19 17:04:20 +02:00
7a9d4bafab Merge branch 'master' into greasepencil-object 2019-09-19 16:40:56 +02:00
8810aea9cd Merge branch 'master' into greasepencil-object 2019-09-19 11:21:00 +02:00
b3cad2b7b7 Merge branch 'master' into greasepencil-object 2019-09-18 21:12:05 +02:00
c88debb3c2 Merge branch 'master' into greasepencil-object 2019-09-18 17:42:01 +02:00
02c5663dea Merge branch 'master' into greasepencil-object 2019-09-17 15:53:42 +02:00
d3ad1b4a1c Merge branch 'master' into greasepencil-object 2019-09-17 13:16:22 +02:00
6cbb2968a9 Merge branch 'master' into greasepencil-object 2019-09-16 10:55:35 +02:00
28d1d31d17 Gpencil: Enable subdiv for 2-point strokes. 2019-09-16 16:06:34 +08:00
072c82f486 Merge branch 'master' into greasepencil-object 2019-09-15 22:29:32 +02:00
b54ccaca35 Merge branch 'master' into greasepencil-object 2019-09-15 18:59:23 +02:00
41c8487ba8 Gpencil: Fix register err from the last commit. 2019-09-15 21:35:55 +08:00
d31db29f78 Gpencil: Removed length & multiply modifiers.
They are in temp-npr-gpencil_modifiers branch cor cleanling up.
2019-09-15 21:27:19 +08:00
3da5f3d895 Merge branch 'master' into greasepencil-object 2019-09-15 12:22:31 +02:00
bbdffae8ac Merge branch 'master' into greasepencil-object 2019-09-14 08:59:25 +02:00
e0161ed2ff Merge branch 'master' into greasepencil-object 2019-09-13 23:06:12 +02:00
b842341a2f Merge branch 'master' into greasepencil-object 2019-09-13 19:30:10 +02:00
bb32382700 Merge branch 'master' into greasepencil-object 2019-09-13 16:27:02 +02:00
f3bf30d040 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/makesdna/DNA_brush_types.h
2019-09-13 15:59:27 +02:00
ccc0ae5b0d Merge branch 'master' into greasepencil-object 2019-09-12 16:30:21 +02:00
fe639017a4 Merge branch 'master' into greasepencil-object 2019-09-12 13:00:55 +02:00
be936b2229 Merge branch 'master' into greasepencil-object 2019-09-12 11:18:50 +02:00
3df8dc4b62 Merge branch 'master' into greasepencil-object 2019-09-11 19:23:05 +02:00
7c9db03cd6 Merge branch 'master' into greasepencil-object 2019-09-11 12:59:51 +02:00
80f73fcb78 Merge branch 'master' into greasepencil-object 2019-09-11 12:05:44 +02:00
6b44a6ca7a Merge branch 'master' into greasepencil-object 2019-09-10 19:55:57 +02:00
a86e936484 Merge branch 'master' into greasepencil-object 2019-09-09 16:27:04 +02:00
f0839ba3db Merge branch 'master' into greasepencil-object 2019-09-09 15:50:23 +02:00
3d3d313d1c Merge branch 'master' into greasepencil-object 2019-09-09 11:08:39 +02:00
4b4de3dab2 Merge branch 'master' into greasepencil-object 2019-09-08 15:50:49 +02:00
c5b364cd24 Merge branch 'master' into greasepencil-object 2019-09-05 19:30:25 +02:00
910bcad912 Merge branch 'master' into greasepencil-object 2019-09-05 17:08:13 +02:00
48bc16af60 Merge branch 'master' into greasepencil-object 2019-09-04 17:29:58 +02:00
5c22c1f90c Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/properties_data_modifier.py
	source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c
2019-09-02 13:40:50 +02:00
b247c14af0 Merge branch 'master' into greasepencil-object 2019-09-02 09:40:12 +02:00
e09026e553 Cleanup code 2019-09-01 11:30:26 +02:00
87a6b936b9 GPencil: Fix compiler warning 2019-09-01 10:35:40 +02:00
229d3d0b3d Merge branch 'master' into greasepencil-object 2019-09-01 09:38:31 +02:00
eb3bba9726 Merge branch 'master' into greasepencil-object 2019-08-31 17:54:49 +02:00
9beb47b802 GPencil: Update convert curves to fix Nurbs problems 2019-08-31 17:54:18 +02:00
64e8a61a8e Merge branch 'master' into greasepencil-object 2019-08-31 09:24:06 +02:00
878f561e55 Merge branch 'master' into greasepencil-object 2019-08-30 16:26:47 +02:00
c2f7315ccd Merge branch 'master' into greasepencil-object 2019-08-30 13:06:23 +02:00
ab4440244d Merge branch 'master' into greasepencil-object 2019-08-29 10:52:27 +02:00
0b11e828ae GPencil: Add support to convert Nurbs curves
Before the operator hadnle only Beziert types.
2019-08-28 13:59:59 +02:00
7892c8d7ff Merge branch 'master' into greasepencil-object 2019-08-28 11:22:47 +02:00
985bbf27b5 Merge branch 'master' into greasepencil-object 2019-08-27 16:00:48 +02:00
6626961234 Merge branch 'master' into greasepencil-object 2019-08-26 22:35:39 +02:00
0c9f8b6906 Merge branch 'master' into greasepencil-object 2019-08-26 15:58:41 +02:00
f5e4fc635f Merge branch 'master' into greasepencil-object 2019-08-26 11:54:03 +02:00
da9a464f94 Merge branch 'master' into greasepencil-object 2019-08-25 20:56:50 +02:00
e30d64cfc1 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_engine.h
2019-08-25 17:09:11 +02:00
901a5def00 GPencil: Reformat how the recalc of stroke is tagged
As now is working with the evaluated data for checking the brush effect, the original stroke must be tagged and not the evaluated one.

Also removed an unneeded copy-on-write tag.
2019-08-24 19:29:00 +02:00
0340f33096 GPencil: Fix typo (rna tooltip cannot end with point) 2019-08-24 18:56:10 +02:00
5fc7058bf9 Merge branch 'master' into greasepencil-object 2019-08-24 18:04:41 +02:00
7ce54d379a GPencil: Tag after sculpt to recalc data 2019-08-24 17:45:05 +02:00
b7cad6914f Cleanup: rename variables to eval instead of derived 2019-08-24 16:25:11 +02:00
279f38f46e Merge branch 'master' into greasepencil-object 2019-08-24 13:47:34 +02:00
5fd8caf715 Merge branch 'master' into greasepencil-object 2019-08-24 13:27:56 +02:00
6141029bfa Merge branch 'master' into greasepencil-object 2019-08-24 13:26:42 +02:00
49235428ff GPencil: Fix changes after merge
Some variables changed and need rename.
2019-08-24 13:20:20 +02:00
9a78dc806b Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenkernel/BKE_gpencil.h
	source/blender/blenkernel/intern/gpencil_modifier.c
	source/blender/draw/engines/gpencil/gpencil_cache_utils.c
	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
	source/blender/draw/engines/gpencil/gpencil_engine.h
	source/blender/makesdna/DNA_object_types.h
2019-08-24 13:09:35 +02:00
cc0e7177e6 Merge branch 'master' into greasepencil-object 2019-08-23 17:20:57 +02:00
c3f8800d47 Merge branch 'master' into greasepencil-object 2019-08-22 18:01:59 +02:00
b8be8f54df GPencil: Verify duplicate SVG materials only for SOLID
For gradient types, each color is a different material.
2019-08-22 16:46:58 +02:00
cf251d5fd7 Merge branch 'master' into greasepencil-object 2019-08-22 12:03:11 +02:00
e9862431cc GPencil: Create Linear gradient fill colors in SVG conversion
There are several limitations in this conversion because SVG support multiple color, but GP only 2. For GP only the extreme colors (first and last) are used.

The mix factor is always set to 0.5.

The angle of the gradient is calculated using the direction of the line defined in Linear gradient.
2019-08-22 12:02:31 +02:00
3036c1fed1 Merge branch 'master' into greasepencil-object 2019-08-21 20:39:34 +02:00
a9c9a08a32 Merge branch 'master' into greasepencil-object 2019-08-21 12:36:51 +02:00
06e2b47490 Merge branch 'master' into greasepencil-object 2019-08-21 11:15:16 +02:00
43fac430e8 Merge branch 'master' into greasepencil-object 2019-08-20 18:13:17 +02:00
0a724fb441 GPencil: Avoid error when material slot is empty in Convert to 2019-08-20 17:04:51 +02:00
44622d063c GPencil: Check the material converted from curves has something
Check the material has Stroke or Fill enabled and avoid unactivated materials.
2019-08-20 13:58:27 +02:00
25b1744981 GPencil: When convert curve do not enable Stroke always
When the converted curve has only fill, the stroke must be set to off.
2019-08-20 12:12:57 +02:00
fac980a2ea Merge branch 'master' into greasepencil-object 2019-08-20 11:10:26 +02:00
c76a9add21 GPencil: Cleanup comments. 2019-08-19 20:56:10 +02:00
b3901a7d69 Merge branch 'master' into greasepencil-object 2019-08-19 20:37:16 +02:00
b056642287 GPencil: Fix last missing point in active Subdivide
The last subdivision point was missing and there was a gap in the point distribution.
2019-08-19 10:28:00 +02:00
a58c6a9cd9 GPencil: Make active Subdivide by pixel distance
Now the subdivision is base on the distance in pixels between last two mouse positions.
2019-08-18 21:03:37 +02:00
acb875be38 GPencil: New Active Subdivide for Brushes
This new option subdivide the last stroke segment while drawing.
2019-08-18 17:50:32 +02:00
3c393ba332 Merge branch 'master' into greasepencil-object 2019-08-18 11:41:49 +02:00
b1ada48b61 Revert "GPencil: Increase number of input samples to 50"
This reverts commit dd370cbf89.
2019-08-18 11:24:18 +02:00
46bdca99ab Revert "GPencil: Increase Input Samples and reduce distance"
This reverts commit 351f87fc84.
2019-08-18 11:23:19 +02:00
fd49a11424 Revert "GPencil: Several changes in Input Samples algorithm"
This reverts commit d78e3bfb33.
2019-08-18 11:23:14 +02:00
d78e3bfb33 GPencil: Several changes in Input Samples algorithm
Changes to test different setups of the algorithm.

Also, the UI value is from 0 to 10, but internally is used squared.
2019-08-17 20:24:18 +02:00
351f87fc84 GPencil: Increase Input Samples and reduce distance
This commit is to test new brushes.
2019-08-17 19:00:12 +02:00
b601109960 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_brush.c
	source/blender/editors/gpencil/gpencil_intern.h
2019-08-17 16:31:36 +02:00
c08e8867c1 GPencil: Fix merge errors 2019-08-16 21:33:22 +02:00
d853f74596 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_edit.c
2019-08-16 21:24:07 +02:00
4e9bcffc39 Merge branch 'master' into greasepencil-object 2019-08-16 12:35:57 +02:00
2551c5b6e6 Merge branch 'master' into greasepencil-object 2019-08-15 13:16:07 +02:00
6cb1a55141 Merge branch 'master' into greasepencil-object 2019-08-14 17:34:06 +02:00
1c22d8818a Merge branch 'master' into greasepencil-object 2019-08-14 16:00:38 +02:00
90183d7d5c GPencil: Smooth pressure in Active Smooth
This smooth is applied while drawing.
2019-08-14 10:23:35 +02:00
8826ecc2a8 GPencil: Run Simplify Adaptive before Smooth Thickness 2019-08-14 08:44:44 +02:00
0a3e04b13b GPencil: Add new Simplify parameter for Brush
This option is to test new types of brushes.
2019-08-13 22:51:46 +02:00
dd370cbf89 GPencil: Increase number of input samples to 50
For testing new brushes.
2019-08-13 22:51:37 +02:00
0e72dbafd2 Merge branch 'master' into greasepencil-object 2019-08-13 22:34:34 +02:00
00869ba1e8 Merge branch 'master' into greasepencil-object 2019-08-12 23:36:06 +02:00
7dec32ea40 Merge branch 'master' into greasepencil-object 2019-08-12 16:24:18 +02:00
62ed289c5f Merge branch 'master' into greasepencil-object 2019-08-10 17:31:13 +02:00
d7fd89bafc Merge branch 'master' into greasepencil-object 2019-08-10 13:18:13 +02:00
bc958747b7 GPencil: Add inverse matrix to macro
This makes the macro similar to editable macro.
2019-08-10 13:17:51 +02:00
295b2e793b Merge branch 'master' into greasepencil-object 2019-08-10 11:40:20 +02:00
7782f529ea Merge branch 'master' into greasepencil-object 2019-08-09 17:58:11 +02:00
b4aeb8df19 GPencil: Fix some minor problems with merge
As the code was ain the branch already, the previous merge had some problems.
2019-08-09 17:57:17 +02:00
a1bbf5200d Merge branch 'master' into greasepencil-object 2019-08-09 17:43:40 +02:00
9087cf593e Merge branch 'master' into greasepencil-object 2019-08-09 15:43:08 +02:00
6ae9dd0902 GPencil: More merge errors
All these errors are related to the problem when merge the LANPR branch to GPencil branch by error.
2019-08-09 13:59:43 +02:00
0ff6eb8681 GPencil: Fix old merge error 2019-08-09 12:38:59 +02:00
acd9ec5571 Merge branch 'master' into greasepencil-object 2019-08-09 12:15:06 +02:00
379aedc3d2 Merge branch 'master' into greasepencil-object 2019-08-09 11:38:04 +02:00
527ed0d320 Merge branch 'master' into greasepencil-object 2019-08-08 17:20:21 +02:00
1cdcbe666e GPencil: Fix merge duplication 2019-08-08 16:57:52 +02:00
c5efb2c3c3 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenkernel/BKE_gpencil.h
	source/blender/blenkernel/intern/gpencil.c
2019-08-08 16:50:21 +02:00
8c580ec944 GPencil: Fix merge error 2019-08-08 15:55:41 +02:00
94c416195e Merge branch 'master' into greasepencil-object 2019-08-08 15:49:36 +02:00
176adad89b Merge branch 'master' into greasepencil-object 2019-08-08 10:47:21 +02:00
c65c0b1045 Merge branch 'master' into greasepencil-object 2019-08-08 10:42:14 +02:00
167565f1dc Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/space_view3d.py
2019-08-08 10:34:35 +02:00
59db505b55 GPencil: Simplify Merge by Distance operator
The old method to interpolate the position created a wrong merge. Now, always the secondary point is merged with the first one, except the last point.
2019-08-07 20:12:46 +02:00
7c98af0a82 Merge branch 'master' into greasepencil-object 2019-08-07 18:25:31 +02:00
9024872ac8 GPencil: New Edit menu structure
Changes by @mendio
2019-08-07 17:01:39 +02:00
93fc7e4c3d GPencil: New operator merge by distance (WIP)
This operator joins points separated by a distance lower than factor. The point is moved to the middle location, except extremes that keep extreme location.
2019-08-07 13:11:21 +02:00
4a8b7904fa Merge branch 'master' into greasepencil-object 2019-08-07 12:16:07 +02:00
76e0123700 GPencil: Fix error after merge 2019-08-07 12:14:00 +02:00
d14ffd77df Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenkernel/BKE_blender_version.h
	source/blender/blenkernel/intern/gpencil.c
	source/blender/blenkernel/intern/gpencil_modifier.c
	source/blender/editors/gpencil/annotate_paint.c
	source/blender/editors/gpencil/gpencil_edit.c
	source/blender/editors/object/object_hook.c
	source/blender/editors/space_clip/clip_graph_draw.c
2019-08-06 22:11:08 +02:00
0aa824cad2 GPencil: Revert wrong merge of LANPR branch
Due to an error, the code of LANPR branch was merged accidentally to the Grease Pencil branch.

This commit reverts all work to the last correct commit.

The command executed was: `git diff ff74822863 | patch -p1 -R`

Thanks to @dfelinto for fixing the error.
2019-08-06 19:44:24 +02:00
7356e92255 Merge branch 'master' into greasepencil-object 2019-07-29 16:46:03 +02:00
ec5d643d3e GPencil: Update stroke loop after merge using macro
During merge, the loop back to old style using for's and now it's using the macro.
2019-07-29 16:24:25 +02:00
c8e9cf3dad Merge branch 'master' into greasepencil-object 2019-07-29 16:13:14 +02:00
29259a318d GPencil: Merge by distance (WIP)
Initial implementation of merge by distance
GPencil: Fix duplicated CMake entry


GPencil: Add missing code for operator in previous commit
2019-07-29 13:56:48 +02:00
6022c2fae2 Merge remote-tracking branch 'origin/greasepencil-object' into soc-2019-npr 2019-07-29 09:06:33 +08:00
ff74822863 GPencil: Cleanup tarnsform rotation function 2019-07-28 17:29:47 +02:00
0473e4c50a Merge branch 'master' into greasepencil-object 2019-07-28 17:06:37 +02:00
a8037f4038 Merge branch 'master' into greasepencil-object 2019-07-27 11:44:21 +02:00
3eecb2806b GPencil: Add Edit support to Length modifier
Now the modifier is visible in edit mode.
2019-07-26 17:28:09 +02:00
9a7f7757f8 GPencil: Fix missing modifiers initialization
This was missing when the modifier was ported from NPR branch
2019-07-26 17:12:00 +02:00
0bbf47ce42 GPencil: Cleanup more compiler warnings 2019-07-26 16:48:22 +02:00
af7d3bb2db GPencil: Remove compiler warnings 2019-07-26 16:43:18 +02:00
4e017abc3d Cleanup: Fixed some warnings in editor/lanpr. 2019-07-26 17:29:43 +08:00
fbbbdf33f2 GPencil: two modifiers from LANPR branch. 2019-07-26 16:47:59 +08:00
bd26db98bc LANPR: UI refactor: line layer ui list use name. 2019-07-26 16:16:56 +08:00
56b29df5cb LANPR: UI refactor: collection usage panel. 2019-07-26 15:59:38 +08:00
a1e758801f LANPR: Object usage flag now in LANPR tab. 2019-07-26 15:54:12 +08:00
284f04a53d LANPR: UI refactor: modifier ui now put into separate tab. 2019-07-26 15:48:29 +08:00
05bf5dab1b GPencil: static and const flags for function/args. 2019-07-26 14:56:46 +08:00
02de8602c8 LANPR: Make flag marcos into enums. 2019-07-26 14:46:52 +08:00
dbd558d574 LANPR: Fixed drawing problems when chaining is enabled. 2019-07-26 12:20:52 +08:00
dd3f69a783 LANPR: Fixed "point" mode in normal control. 2019-07-26 11:33:36 +08:00
52db223bd6 LANPR: UI refactor: naming fixes in the main panel. 2019-07-26 11:09:11 +08:00
cbaab41450 LANPR: UI refactor: option sub panel fixes. 2019-07-26 11:04:58 +08:00
ee73885bd1 Merge remote-tracking branch 'origin/master' into soc-2019-npr 2019-07-26 11:00:53 +08:00
a2fb1f367b Merge remote-tracking branch 'origin/greasepencil-object' into soc-2019-npr 2019-07-26 11:00:41 +08:00
80a6acd814 Cleanup: Remove . at the end of text 2019-07-25 14:03:02 +02:00
c6fbc1db41 Merge branch 'master' into greasepencil-object 2019-07-25 12:41:59 +02:00
9e4cc7c630 Merge remote-tracking branch 'origin/master' into soc-2019-npr 2019-07-25 14:34:45 +08:00
caab047f9c LANPR: UI refactor: added script for object lanpr tab. 2019-07-24 17:10:44 +08:00
22e330b4b0 LANPR: Added a dedicated tab for feature line modifier options. 2019-07-24 16:59:13 +08:00
16a453dd9c LANPR: UI refactor: gpencil panel. 2019-07-24 16:11:40 +08:00
6e2f3ee26a LANPR: UI refactor: options panel. 2019-07-24 15:59:43 +08:00
6acc7d4015 LANPR: UI refactor: chaining panel. 2019-07-24 15:50:43 +08:00
86fa225164 LANPR: UI refactor: effects panel. 2019-07-24 15:44:46 +08:00
1616a6a57f LANPR: use LANPR_LineType for duplicated style storage. 2019-07-24 10:55:54 +08:00
b4f707424e LANPR: UI refactor: main panel. 2019-07-24 10:22:06 +08:00
349f7b8f32 Merge remote-tracking branch 'origin/greasepencil-object' into soc-2019-npr 2019-07-24 09:03:51 +08:00
09a774c3c0 GPencil: Remove duplicate self overlap option
The option was duplicated for textured strokes.
2019-07-23 13:32:57 +02:00
8441fa98f7 Merge branch 'master' into greasepencil-object 2019-07-23 09:48:00 +02:00
0abf6d349c Cleanup: Rename poll function 2019-07-22 16:54:42 +02:00
2f1c33d87b LANPR: Fixed render alpha in LANPR engine. 2019-07-22 10:09:11 +08:00
37ca6d2947 Merge remote-tracking branch 'origin/master' into soc-2019-npr 2019-07-22 09:55:46 +08:00
b5c3dbc359 Fix assert in some cases when using DataTransfer modifier for custom normals.
Reported by @sybren on IRC, thanks.

Should be safe for 2.80.
2019-07-22 08:54:00 +08:00
6fff1f2b6e Merge branch 'master' into greasepencil-object 2019-07-21 22:34:05 +02:00
f491355c43 Merge remote-tracking branch 'origin/greasepencil-object' into soc-2019-npr 2019-07-20 16:41:35 +08:00
475aca05ab GPencil: Fix errors after merge and compiler warnings
The BKE_text_write function parameter list changed.

Added some UNUSED_VARS to functions in development.
2019-07-19 15:51:09 +02:00
c4b57de36e Merge branch 'master' into greasepencil-object 2019-07-19 15:29:45 +02:00
39341441f1 GPencil: Add frame parameter to deformStroke callback
This parameter can be necessary for some new modifiers in development. The parmeter was already there but it was removed, now we back again the parameter.
2019-07-19 15:26:29 +02:00
b07a0fe41d LANPR: Use GPU_BATCH_DISCARD_SAFE marco. 2019-07-19 17:05:13 +08:00
9b0c3c39a6 LANPR: Remove useless GPU_ATTACHMENT_LEAVE flags. 2019-07-19 17:03:06 +08:00
0c69893bd6 LANPR: Renamed freestyle edge mark constant into lanpr. 2019-07-19 16:26:08 +08:00
0a6dd063ef LANPR: Edge/face mark UI now forllows LANPR checkbox. 2019-07-19 16:26:08 +08:00
7dfb221aca LANPR: Remove freestyle #ifdef's. 2019-07-19 16:26:08 +08:00
a693068047 LANPR: Rename freestyle edge mark functions to LANPR. 2019-07-19 16:26:08 +08:00
3912e4439a Cleanup: Replace if else if, by Switch 2019-07-19 10:18:51 +02:00
69c8d314cf Merge branch 'master' into greasepencil-object 2019-07-18 22:24:14 +02:00
69218e4d9a GPencil: Remove old comments 2019-07-18 22:23:14 +02:00
b05570736c GPencil: Testing idea for changing weights when opacity factor is greater than 1.0 2019-07-18 20:50:03 +02:00
3f4e87e987 GPencil: Clamp weight in Opacity modifier for Material mode
If the value is not clamped, the opacity gets wild values.
2019-07-18 20:25:29 +02:00
092f9ead20 GPencil: Apply opacity only to vertex with weights 2019-07-18 20:22:54 +02:00
8fc1be0c2b GPencil: Fix unreported error in Brush option panel
The options of the material are from object material not pinned material.

If the brush is pinned, the material must be the brush material and not the object material.
2019-07-18 19:52:52 +02:00
2cef81ac4f GPencil: Modify opacity modifier to use weights inverted
It's more logic consider the no weight as opaque and the weight to transparent.

Also fixed some small issues.
2019-07-18 19:38:45 +02:00
71eda41ae9 GPencil: Fix error when apply material in Opacity/Hue and Tint 2019-07-18 18:07:56 +02:00
35af94cc86 GPencil: New Strength mode for Opacity modifier
Now it's possible to determine the opacity by Material (default) or by point Strength.

This new mode is required to get some effects using weight data.
2019-07-18 18:07:34 +02:00
8bfa7e1c72 GPencil: Fix error with evaluated colors after changing evaluation to depsgraph
The temporary colors were not copied when the derived frame was created.

The color must be copied in evaluation, not in draw manager because this replace any modifier change.
2019-07-18 18:03:14 +02:00
c6f6d6ef09 GPencil: Enable gradient factor for Line strokes
Now it's possible to use the same gradient used in Dots and Boxes with Line strokes. This was disabled, pending to solve the overlap glitches, but as this was fixed with stencil, we can enable it again.

Also, the gradient formula has been changed to use the same of Dots.
2019-07-18 16:50:43 +02:00
995c0f84a6 LANPR: Remove mode selector when not in LANPR engine. 2019-07-18 19:47:13 +08:00
ea4119b894 LANPR: Removed edge detection entry in the mode selector. 2019-07-18 19:29:48 +08:00
7c476569e5 Merge remote-tracking branch 'origin/master' into soc-2019-npr 2019-07-18 15:55:48 +08:00
6e38a00d45 GPencil: Fix length modifier wrong callback. 2019-07-18 15:12:13 +08:00
c0bc74fb5e LANPR: Description of auto update write as "frame changes". 2019-07-18 14:36:44 +08:00
bf7727c976 Cleanup: Make format. 2019-07-18 14:34:32 +08:00
46b84938fa GPencil: Sample modifier accepts 3 points at least. 2019-07-18 14:33:34 +08:00
10ff3061dc GPencil: Relieable counter for sample function. 2019-07-18 14:23:12 +08:00
0507d41374 Merge branch 'master' into greasepencil-object 2019-07-17 23:02:30 +02:00
4759a0f0a6 Merge branch 'master' into greasepencil-object 2019-07-17 22:10:17 +02:00
fc40a09531 GPencil: Move initial curve control points apart
Based on feedback from @matiasmendio
2019-07-17 17:08:55 +01:00
80779629dc GPencil: Sample function new counter (not working properly). 2019-07-17 22:10:12 +08:00
2b17ee6cd4 Merge remote-tracking branch 'origin/master' into soc-2019-npr 2019-07-17 20:03:31 +08:00
7f1acb3c51 Merge branch 'master' into greasepencil-object 2019-07-17 11:15:07 +02:00
e2a7fca986 GPencil: Make sample modifier a part of simplify modifier. 2019-07-17 14:40:00 +08:00
01e91a4215 LANPR: Feature line modifier UI consistensy with the rest. 2019-07-17 14:18:25 +08:00
957348116b GPencil: Renamed modifier "Length". 2019-07-17 14:12:18 +08:00
c7156dd30c GPencil: Renamed modifier into "MultiStroke". 2019-07-17 14:08:48 +08:00
93c4a93328 Merge remote-tracking branch 'origin/master' into soc-2019-npr 2019-07-17 13:57:21 +08:00
1e0f4ba138 GPencil: Allow widng curve when normalize on in thickness modifier. 2019-07-17 11:20:15 +08:00
1ee17517f9 LANPR: Generate 100px wide original stroke for GPencil. 2019-07-17 11:06:33 +08:00
0d73e79966 Merge branch 'master' into greasepencil-object 2019-07-16 18:06:58 +02:00
c85f8ae5b2 Merge branch 'master' into greasepencil-object 2019-07-16 16:43:39 +02:00
665b57e0b9 Fix MSVC type error. 2019-07-16 22:42:30 +08:00
8a124f86c4 GPencil: Use alpha channel of curve material
Now the grease pencil stroke is using the alpha channel of the original curve material.
2019-07-16 16:30:55 +02:00
33596f237c LANPR: Stop splitting chains in CPU mode. 2019-07-16 20:50:53 +08:00
3afe60b2c4 LANPR: Auto update GPencil when in other engines. 2019-07-16 20:23:01 +08:00
0df10ebf3f GPencil: Use alpha component for converting splines
The alpha channel was not used before.

Note: This is a previous step before changing svg add-on to support alpha.
2019-07-16 13:45:33 +02:00
cb17dba738 Merge remote-tracking branch 'origin/greasepencil-object' into soc-2019-npr 2019-07-16 19:36:44 +08:00
9a0c100e6c LANPR: GPU mode batch refresh method changes. 2019-07-16 19:35:15 +08:00
575fff2209 GPencil: Cleanup MSVSC warnings 2019-07-16 13:11:34 +02:00
157dc60dc8 Merge branch 'master' into greasepencil-object 2019-07-16 12:14:36 +02:00
43343509b9 GPencil: Improve curve conversion when end points are very near
When the distance between first and last point of the curve was very small, there was a glitch in the join. Now the points are moved slightly to get good result.
2019-07-16 12:13:45 +02:00
4cda368ef6 GPencil: Improve Close stroke function for very small gaps
When the gap is very small, don't need to add new points to the stroke, just cyclic.
2019-07-16 11:31:05 +02:00
a808ade3a2 GPencil: Create one stroke for each spline
For curves with several splines, must create a stroke for each of them or the shape would be wrong.
2019-07-16 11:00:19 +02:00
cfdd663679 Merge branch 'master' into greasepencil-object 2019-07-15 17:22:35 +02:00
5b31532ec3 LANPR: Moved GPU batches to lanpr_share. 2019-07-15 22:18:23 +08:00
bb4c9ae09b LANPR: Fixing memeory leaking in GPU mode. 2019-07-15 21:29:21 +08:00
ba07ebb4cf Cleanup: Make format 2019-07-15 17:10:39 +08:00
43a15ac599 Cleanup: ED Declareations move into ED_lanpr.h 2019-07-15 17:05:43 +08:00
7f9a4d521a Cleanup: Redundant defines. 2019-07-15 16:51:56 +08:00
a0d8953335 Math: Double version of interpolate functions. 2019-07-15 16:45:09 +08:00
4a8167e026 Cleanup: Removed utility files. 2019-07-15 16:02:23 +08:00
67d493f6f2 Cleanup: LANPR draw engine codes. 2019-07-15 16:00:47 +08:00
31a71467e4 LANPR: Fixing function prefixes. 2019-07-15 15:55:14 +08:00
42b8ba32c1 Merge remote-tracking branch 'origin/greasepencil-object' into soc-2019-npr 2019-07-15 14:01:00 +08:00
648bd58595 GPencil: Change default value in python API
The gpencil_lines must be set to False by default.
2019-07-14 20:55:02 +02:00
7393ca434d GPencil: Set gpencil_lines parameter to False by default 2019-07-14 17:23:27 +02:00
58b7d61ebf GPencil: Fix problem when color is nofill in SVG
If the color in the SVG converted was nofill, the stroke had fill color in grease pencil and this creates glitches because the shape was not defined to be filled.

Now, the name of the color is checked to verify if the material is for stroke, and if only there is one material with this name, the fill is disabled.
2019-07-14 17:19:45 +02:00
e4c9f9d953 GPencil: Fix error generating strokes with curves with 2 points only
The number of segments must be 1 if the number of control points is 2. The problem was with the closed curves.

Also added tag of the databalock.
2019-07-14 14:33:23 +02:00
af6a5bc071 GPencil: Apply curve radius as pressure for stroke point
When convert the curve, the beziert point radius is used to generate the pressure of the grease pencil stroke point and this allows to generate different thickness.
2019-07-14 11:04:31 +02:00
f05a18f0fa GPencil: Rename python API function from convert_to_gpencil to generate_gpencil_strokes
The problem with old name was that it implied that original object was removed, but the function only creates the strokes, so the new name is better.
2019-07-14 10:46:22 +02:00
65bde9334d Merge remote-tracking branch 'origin/greasepencil-object' into soc-2019-npr 2019-07-14 14:23:03 +08:00
9546718f32 Merge branch 'master' into greasepencil-object 2019-07-13 11:35:27 +02:00
96339b8ea4 LANPR: Moved lanpr_util.c into ED. 2019-07-13 17:35:07 +08:00
141382d6f2 LANPR: Moved non-drawing related chaining code to ED. 2019-07-13 17:07:29 +08:00
ef16f19845 LANPR: Fixing local functions. 2019-07-13 16:28:22 +08:00
5b3ab68ae7 LANPR: Fixing local function and naming. 2019-07-13 16:19:55 +08:00
625fa7f276 LANPR: Moved CPU side calculations to ED. 2019-07-13 16:00:52 +08:00
f444749064 LANPR: Line layer operators now moved to ED 2019-07-13 15:23:55 +08:00
e6273ea3c7 LANPR: Changed to ED_ prefix. 2019-07-13 14:36:23 +08:00
897db2ba77 LANPR: Move GPencil operators into ED 2019-07-13 14:13:42 +08:00
8e8dac8160 Merge remote-tracking branch 'origin/master' into soc-2019-npr 2019-07-13 10:44:24 +08:00
e1ce914c1e Merge remote-tracking branch 'origin/greasepencil-object' into soc-2019-npr 2019-07-12 09:13:44 +08:00
ae57188191 Merge branch 'master' into greasepencil-object 2019-07-11 17:21:22 +02:00
c6896fa780 Merge remote-tracking branch 'origin/greasepencil-object' into soc-2019-npr 2019-07-11 07:56:04 +08:00
ff12988a49 GPencil: Cleanup commet 2019-07-10 22:53:44 +02:00
3ba6576a32 GPencil: Remove extra parameters to Convert API
Scene can be removed using context. Also bmain can be removed too.
2019-07-10 21:09:18 +02:00
3ed7b3b37c GPencil: Add notifier to update new created stroke 2019-07-10 17:45:06 +02:00
8e8673483d GPencil: Change default parameter use_collections to True 2019-07-10 17:37:58 +02:00
8b3afb178a GPencil: Fix double definition
The gpl was out of scope due double definition.
2019-07-10 17:37:33 +02:00
097ae32e2b Merge branch 'master' into greasepencil-object 2019-07-10 17:12:31 +02:00
c524490425 GPencil: Basic python api to convert curve to strokes 2019-07-10 17:12:05 +02:00
9ad5e8cacc LANPR: Fix return type error. 2019-07-10 21:28:19 +08:00
74ae87d1d4 LANPR: Fix missed library linking. 2019-07-10 21:13:40 +08:00
8fc5c61974 LANPR: Move data defs and the svg modifier into editor/lanpr. 2019-07-10 21:09:39 +08:00
6cbc913b00 Cleanup: make format. 2019-07-10 20:32:35 +08:00
16ddb6a6f7 LANPR: use ED_ functions for SVG export. 2019-07-10 20:28:26 +08:00
88c5c92b03 Merge branch 'greasepencil-object' into soc-2019-npr 2019-07-10 20:14:44 +08:00
222deeee3d SVG: functions moved to editors/io for ease of external access. 2019-07-10 20:10:33 +08:00
905b70f9a4 LANPR: SVG export callbacks. 2019-07-10 13:43:35 +08:00
a412b5c7fb LANPR: Added operator for exporting svg. (Not functioning) 2019-07-10 11:08:40 +08:00
6a9c424b76 Merge branch 'greasepencil-object' into soc-2019-npr 2019-07-10 10:49:31 +08:00
fc34653ce2 Gpencil: Basic SVG export callback is running OK. 2019-07-10 10:48:10 +08:00
f27629c593 Gpenci: Fix missing path end markings in writesvg.c 2019-07-10 09:55:50 +08:00
ef7587c4d5 Gpencil: Renamed GPencilSVGWriter into GPencilSVGIterator. 2019-07-10 09:45:59 +08:00
b4f39f5ee9 Merge remote-tracking branch 'origin/greasepencil-object' into soc-2019-npr 2019-07-10 09:31:56 +08:00
00b5bda6ae Merge branch 'master' into greasepencil-object
Conflicts:
	release/datafiles/locale
	release/scripts/addons
	release/scripts/addons_contrib
	source/tools
2019-07-09 23:23:26 +02:00
2e7dee3fb9 GPencil: Add "Self Overlap" parameter to materials to disable Stencil
This parameter was removed in 2.80 and we decided to back again, but now is inverted.
2019-07-09 23:11:36 +02:00
2708e25e4e GPencil: Use dynamic array size for SBuffer while drawing
This is to solve the fixed limit defined before.

Also some cleanup and renames.
2019-07-09 22:53:06 +02:00
8742dedaab GPencil: Fix possible memory leak in function
The function exit before the END_ITER
2019-07-09 22:44:26 +02:00
58888e7f87 GPencil: Undo clang reformat lines and keep old format
These lines were changed by clang and don't need to be changed.
2019-07-09 16:44:07 +02:00
b76eb572fc LANPR: don't use zero value in chaining. 2019-07-09 22:01:53 +08:00
0fecf69adb Merge branch 'greasepencil-object' into soc-2019-npr 2019-07-09 15:42:30 +08:00
bf73c8bf39 Gpencil: svg export operator 2019-07-09 15:42:09 +08:00
11423f922b Gpencil: svg callbacks. 2019-07-09 14:47:58 +08:00
a4f499eb23 Merge branch 'greasepencil-object' into soc-2019-npr 2019-07-09 12:01:40 +08:00
f4b4e77312 Gpencil: error fixes. 2019-07-09 11:54:22 +08:00
91d21adabd Merge branch 'greasepencil-object' into soc-2019-npr 2019-07-09 11:42:32 +08:00
176ef101a0 Gpencil: Fixed include errors in writesvg.c 2019-07-09 11:41:46 +08:00
f3e08bbf50 Gpencil: fixed writesvg.c include errors. 2019-07-09 11:40:24 +08:00
37d111b30b Merge branch 'greasepencil-object' into soc-2019-npr 2019-07-09 11:33:04 +08:00
cd931d48a6 Gpencil: Fix non-return error. 2019-07-09 11:32:22 +08:00
97d6c9bae9 Merge branch 'greasepencil-object' into soc-2019-npr 2019-07-09 11:24:46 +08:00
c2e46946a7 Gpencil: svg exporter initial. 2019-07-09 11:23:29 +08:00
3ecac8b2e5 Merge branch 'master' into soc-2019-npr 2019-07-09 09:14:58 +08:00
710eb7b3a9 Merge branch 'master' into greasepencil-object 2019-07-08 20:50:48 +02:00
3fb21e6010 LANPR: Fix CPU mode overlay display error. 2019-07-08 22:24:03 +08:00
b922253366 Merge branch 'master' into greasepencil-object 2019-07-08 16:04:41 +02:00
aa25207c44 Cleanup: make format 2019-07-08 21:34:32 +08:00
b3b40fca75 LANPR: CPU mode camera view pan/zoom aligned. 2019-07-08 21:26:26 +08:00
e410f352d6 GPencil: Fix Select material operator not refresh viewport
With the change to depsgraph evaluation, need tag the datablock to refresh screen.
2019-07-08 12:21:06 +02:00
3ad90ba731 GPencil: Use secondary material for stroke color 2019-07-08 11:55:12 +02:00
b5da6a9126 LANPR: Fixing CPU mode camera view scale. 2019-07-08 17:52:56 +08:00
a04dafceff LANPR: CPU mode shaders now follow viewport zoom/pan values. 2019-07-08 17:29:42 +08:00
5e6e550861 GPencil: Use collection names as layer names in conversion from curves 2019-07-08 11:03:45 +02:00
ebeb3b84c0 LANPR: Panels in object and collection page always display when engine is selected 2019-07-08 16:29:51 +08:00
2a15303a8f LANPR: GPU mode now supports all three usage flags in objects and collections. 2019-07-08 16:24:35 +08:00
1f875e60b7 LANPR: GPU mode follow object/collection usage flag. 2019-07-08 16:15:20 +08:00
3f1072d827 Merge branch 'master' into greasepencil-object 2019-07-08 10:08:28 +02:00
f96f91512c LANPR: UI and operator guard for null camera situations. 2019-07-08 15:28:28 +08:00
4aa84a312a Fix line layer init level errors. Default follow world color 2019-07-08 15:11:16 +08:00
85d36aebf4 LANPR: able to toggle two background colors. 2019-07-08 14:58:09 +08:00
2948779839 LANPR: option to use the world background. 2019-07-08 14:29:31 +08:00
6120e6ef06 GPU preview and render mode now follows background alpha correctly. 2019-07-08 13:56:06 +08:00
b0385f514f LANPR: Modifier ui now deactivates correctly. 2019-07-08 13:07:52 +08:00
f1bfe10c82 Merge remote-tracking branch 'origin/master' into soc-2019-npr 2019-07-08 12:27:34 +08:00
85f13246ad Merge branch 'master' into greasepencil-object 2019-07-07 09:39:40 +02:00
ae8976b596 Cleanup: Use zero_v4 to init the default value. 2019-07-06 23:47:00 +08:00
3bd56a33d9 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_engine.h
2019-07-06 16:16:08 +02:00
fe31148d16 GPencil: Remove custom equals functions and reuse BLI_math compare
I have found the compare function when looking at BLI_math to add my functions, so these are duplicatd and can be removed.
2019-07-06 11:56:08 +02:00
e57d50d4d4 GPencil: Cleanup equals functions and add for floats and V2 2019-07-06 11:48:48 +02:00
6702da509a Merge remote-tracking branch 'origin/master' into soc-2019-npr
# Conflicts:
#	source/blender/draw/intern/draw_manager.c
2019-07-06 10:03:47 +08:00
9c0b207819 Merge branch 'master' into greasepencil-object 2019-07-05 22:15:31 +02:00
e125f3d3ae Merge branch 'master' into greasepencil-object 2019-07-05 17:10:33 +02:00
b8b88b7d52 GPencil: Improve management of curves without material
The SVG to Curves add-on gets some curves without material. Now these curves are set to a Pink material.
2019-07-05 17:09:54 +02:00
0f606437c3 Cleanup: Fix build error with MSVC
space after \ is not allowed
2019-07-05 07:12:45 -06:00
eebcad2813 LANPR: Minor display fixes. 2019-07-05 20:55:41 +08:00
8697062438 LANPR: Fix MSVC errors. 2019-07-05 20:49:49 +08:00
741c286e2b GPencil: Improves color handling for converted curves
Reduce the number of very similar colors.

Note: Maybe equals_v3v3_limit and equals_v4v4_limit could be added to BLI_math but with some cleanup and adding v2 version too
2019-07-05 10:41:12 +02:00
693cecab70 LANPR: Disable header checkbox when in LANPR engine. 2019-07-05 15:57:20 +08:00
e9bac3a23a LANPR: Modified default values for better initial experience. 2019-07-05 15:18:11 +08:00
38b68fa8fa LANPR: Enable Freestyle mark functions when LANPR is enabled. 2019-07-05 15:05:34 +08:00
ee1e72a316 Gpencil: make format 2019-07-05 14:52:04 +08:00
b28eb5e339 Gpencil: Fading in duplicate modifier. 2019-07-05 14:33:22 +08:00
61ccd2fa38 Gpencil: Duplicator stroke fading data structures. 2019-07-05 13:37:28 +08:00
f7c0fce061 Gpencil: Fix stroke duplication offset and UI slider. 2019-07-05 12:04:01 +08:00
bcb12f6a6c Gpencil: Fixed distance interpolation in multiply modifier. 2019-07-05 11:27:16 +08:00
e2cc428686 LANPR: Fixed GPU mode
bug: contour is always on.
2019-07-05 10:44:56 +08:00
de1994174b LANPR: Fixed always-on contour in UI. 2019-07-05 10:17:41 +08:00
80939ade23 LANPR: Improved line layer display in the list. 2019-07-05 10:11:27 +08:00
4052d68a00 LANPR: Discard source object stroke update functions. 2019-07-05 09:57:13 +08:00
fb96cbcf21 LANPR: Stroke update button for GP targets and mesh source objects. 2019-07-05 09:15:00 +08:00
e6421de53b LANPR: GPU mode empty layer list prompt. 2019-07-05 08:29:18 +08:00
4ff47d66b3 LANPR: GP target updater overwrite option. 2019-07-05 08:21:10 +08:00
1c2a22bb18 LANPR: Improvements of disable_edge_splits function. 2019-07-05 07:55:15 +08:00
3f7ed2261e Merge branch 'master' into soc-2019-npr 2019-07-05 07:37:58 +08:00
ae3116b49d GPencil: Fix error in Convert to Stroke with materials
The material color was checked in linear, but the gpencil material is sRGB.
2019-07-04 23:16:14 +02:00
fa39bdacf0 GPencil: New convert Curve to Stroke
New operator to convert any curve to grease pencil stroke.

The conversion works as a new option for Convert To operator.

Added a new parameter for selecting the color of the stroke.
2019-07-04 22:57:00 +02:00
c9d046c992 Merge branch 'master' into greasepencil-object 2019-07-04 22:48:45 +02:00
1455e56f28 Merge branch 'master' into greasepencil-object 2019-07-04 17:05:00 +02:00
7aed5dcad9 Merge remote-tracking branch 'origin/master' into soc-2019-npr 2019-07-04 22:35:59 +08:00
10098812d3 LANPR: Intersection cache now updates before lanpr_cache_finish(). 2019-07-04 22:12:07 +08:00
0e19957ea1 LANPR: CPU mode chaining use deep bounding areas. 2019-07-04 16:18:55 +08:00
59da33fdb6 LANPR: fixed one coordinate bug in triangle culling function. 2019-07-04 15:10:48 +08:00
e2d3553343 LANPR: Fix GPU overflow prevention. 2019-07-04 14:56:11 +08:00
4530bb4f4d LANPR: use minimum occlusion level needed to speed up CPU mode. 2019-07-04 14:31:23 +08:00
28212da97f LANPR: new layer now increase occlusion level automatically. 2019-07-04 13:49:52 +08:00
321f92424e LANPR: Remove composition operators. 2019-07-04 13:25:09 +08:00
fe573ce914 LANPR: GPU mode prevent overflow. 2019-07-04 12:47:31 +08:00
ff78b59b7c LANPR: GPU mode follow cache size settings. 2019-07-04 12:33:30 +08:00
09df147f8d LANPR: GPU mode cache size option. 2019-07-04 12:05:25 +08:00
5ddcffa17c Merge branch 'master' into soc-2019-npr 2019-07-04 10:46:15 +08:00
adab7242d4 LANPR: Fixed _UL_ name warnings. 2019-07-03 21:56:32 +08:00
6b179c7f86 LANPR: Image chaining threshold set higher bound. 2019-07-03 17:06:04 +08:00
a44d39800b Gpencil: Duplication modifier is working now. 2019-07-03 16:49:23 +08:00
1aa8870b95 Gpencil: Length modifier now handles relative lengths 2019-07-03 15:08:44 +08:00
caa004c6bc LANPR: GP update will now delete data in the original frame. 2019-07-03 14:33:37 +08:00
95cf3a3234 LANPR: Automatically update cache before drawing. (by a switch) 2019-07-03 14:04:15 +08:00
d7174b1860 LANPR: Automatically update LANPR calculation in gp update button. 2019-07-03 13:44:41 +08:00
0a13fde96d Gpencil: Multiply modifier angle split functions 2019-07-03 11:59:29 +08:00
89e1c3ca68 Gpencil: int/float length fix 2019-07-03 11:30:04 +08:00
c2ec2affd1 Gpencil: Stroke split function. 2019-07-03 11:09:58 +08:00
7e0a7639be Gpencil: clean up length modifier callback 2019-07-03 10:45:33 +08:00
f194ab1950 Merge branch 'master' into soc-2019-npr 2019-07-03 10:20:33 +08:00
54919b2543 Merge branch 'master' into greasepencil-object 2019-07-02 20:37:37 +02:00
f449908451 LANPR: GP target reset button 2019-07-02 17:46:26 +08:00
dfb78e2ba0 Gpencil: Cleanup debug prints and comments. 2019-07-02 16:55:03 +08:00
577d049336 Gpencil: Shrink functions and modifier is working properly. 2019-07-02 16:50:03 +08:00
889919e707 Gpencil: Multiply modifier added. (not functioning) 2019-07-02 15:21:16 +08:00
a562e1fa81 Gpencil: Renamed "Backbone" into "Length" modifier. 2019-07-02 14:38:56 +08:00
2d01192c4d LANPR: intersection update button in GPU mode, small UI modifications. 2019-07-02 14:27:08 +08:00
858539520e LANPR: Only calculates intersection lines when not in software modes. 2019-07-02 14:16:01 +08:00
c216cb6a69 Merge branch 'master' into soc-2019-npr 2019-07-02 13:11:58 +08:00
98e744c549 Merge branch 'master' into greasepencil-object 2019-07-01 15:50:53 +02:00
8d8200c173 Gpencil: Stretch function now handles short segments and double points. 2019-07-01 20:22:52 +08:00
aa111b0b91 Gpencil: Stroke stretch function use copy instead of directly assign. 2019-07-01 19:51:58 +08:00
563b784f2b LANPR: make format 2019-07-01 17:33:00 +08:00
1074150f2a LANPR: defaults in new line layers. 2019-07-01 17:21:18 +08:00
a083fb84d4 LANPR: Fixed line level error in engine self rendering. 2019-07-01 17:16:03 +08:00
570f2814ac Merge branch 'master' into greasepencil-object 2019-07-01 11:13:22 +02:00
e3b9dfd357 LANPR: viewport auto update in LANPR line layer operators. 2019-07-01 17:02:31 +08:00
6f090b3e37 LANPR: Updating GPencil will now automatically redraw. 2019-07-01 16:30:14 +08:00
c2254194f8 LANPR: Chaining is force enabled for engines other than LANPR. 2019-07-01 16:06:43 +08:00
506dbb8cff LANPR: discard very short chains. 2019-07-01 15:50:56 +08:00
5ac143dbe8 Modifier: EdgeSplit modifier now follows LANPR "disable_edge_splits" as well. 2019-07-01 15:35:14 +08:00
94bee8fa25 Modifier: EdgeSplit modifier now has ignore_lanpr option. 2019-07-01 15:15:46 +08:00
b2ca257e63 LANPR: modified buttons and panels for non-LANPR engine display. 2019-07-01 14:50:34 +08:00
a620a2442f LANPR: Add LANPR to COMPACT_ENGINES in relevant panels. 2019-07-01 10:30:35 +08:00
d3dcb70f61 LANPR: remove unnecessary options when only generating GPencil strokes. 2019-07-01 10:10:12 +08:00
27ca5cdfee Merge branch 'master' into soc-2019-npr 2019-07-01 09:49:08 +08:00
bc3ef662d8 GPencil: Fix error in Thickness and Strength for closing strokes
The values were inverted.
2019-06-30 11:07:12 +02:00
541f66ffea GPencil: Add support for multiframe to Cyclic operator
This operator was working with active frame only.
2019-06-30 11:02:16 +02:00
ddc12efa21 GPencil: Remove Close operator and reuse Cyclic operator
Cyclic could do the same, so it's not logic to have duplicate code.
2019-06-30 11:01:51 +02:00
fad8b45df5 Merge branch 'master' into greasepencil-object 2019-06-30 11:00:41 +02:00
7130eee812 GPencil: Change poll method for Close stroke operator
Must be edit mode and 3D view.
2019-06-29 21:02:00 +02:00
e7b49aa84a GPencil: Add F key to close strokes 2019-06-29 21:01:54 +02:00
b5d4c081de GPencil: New parameter to create geometry when set stroke to cyclic
In grease pencil is not logic to join without geometry.
2019-06-29 21:01:48 +02:00
d5bebb33b2 GPencil: New Close Stroke operator
This operator allows to close a stoke generating geometry for the closing gap.

This is totally different of Cyclic, because this was only a visual closing, but as there wasn't new geometry, you could sculpt or edit and need manual subdivide.
2019-06-29 16:43:10 +02:00
5e8f7c439b Merge branch 'master' into greasepencil-object 2019-06-29 16:42:46 +02:00
7b725f55e1 Merge branch 'master' into greasepencil-object 2019-06-28 15:41:24 +02:00
37c3aa8eab LANPR: fix readfile pointer address. 2019-06-28 19:59:19 +08:00
9fc9ee742e LANPR: intersection strokes are now generated in the first collection. 2019-06-28 19:00:31 +08:00
d1ed9ddef2 Merge branch 'master' into greasepencil-object 2019-06-28 11:49:51 +02:00
d1d7dc4373 Gpencil: fixed "totweight" count in sample functions. 2019-06-28 15:00:20 +08:00
ec580226e8 Gpencil: make format 2019-06-28 14:51:38 +08:00
715458f413 Gpencil: New sample function which handles weights. 2019-06-28 14:49:59 +08:00
dd9579ccd4 LANPR: Added error message for failed DPIX shaders. 2019-06-28 14:05:11 +08:00
6d3e0a94f6 Merge branch 'master' into soc-2019-npr 2019-06-28 13:08:51 +08:00
56bc8e929a Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
2019-06-27 16:44:09 +02:00
605f492237 LANPR: make format. 2019-06-27 16:40:56 +08:00
0ce9471b49 LANPR: Fixed an accidental if() bracket error in lanpr_line_crosses_bounding_area(). 2019-06-27 16:03:56 +08:00
2d247cbda1 LANPR: GP stroke bake function. 2019-06-27 15:48:54 +08:00
a0c45cdaa4 LANPR: selective line type now working for objects and collections 2019-06-27 14:43:37 +08:00
3c185098c6 LANPR: ensure chain only contains one type of segments. 2019-06-27 14:35:02 +08:00
7be203b070 LANPR: collection line type selecot and default values. 2019-06-27 14:27:07 +08:00
a230ab1571 LANPR: first-time chain only includes the same type of lines. 2019-06-27 14:00:15 +08:00
0af490ede4 LANPR: enable switch now operative in software mode 2019-06-27 13:55:48 +08:00
1067924979 LANPR: modified modifier and main panel UI for clarity. 2019-06-27 13:05:20 +08:00
2712d082d3 Merge remote-tracking branch 'origin/master' into soc-2019-npr 2019-06-27 12:03:21 +08:00
f0a225f524 LANPR: modified "item" into prev/next in lanpr_data_types.h 2019-06-26 21:50:13 +08:00
0751c14dd3 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
2019-06-26 13:41:24 +02:00
a400ce4a3d LANPR: collection GP target now working. 2019-06-26 17:02:18 +08:00
3fffd652f6 LANPR: collection and object usage flags now effective. object flags overrides modifier. 2019-06-26 16:28:21 +08:00
0d0f3801cd LANPR: Object usage flag is effective now. 2019-06-26 15:32:53 +08:00
a943a2edaa LANPR: move "usage" settings into struct ObjectLANPR. 2019-06-26 15:20:35 +08:00
fbbffc0420 LANPR: separate thresholds for image/geometry space chaining. 2019-06-26 14:29:28 +08:00
a4147edb3e LANPR: Fixed occlusion bugs in first-step chaining. 2019-06-26 14:02:20 +08:00
85aa8ab273 LANPR: shaders now support main color/thickness. 2019-06-26 13:28:02 +08:00
c6f58fc523 Merge branch 'master' into soc-2019-npr 2019-06-26 12:44:13 +08:00
d6eeb656ea LANPR: all the if() statements now use {} brackets. 2019-06-25 17:43:01 +08:00
52e35cd224 Merge branch 'master' into greasepencil-object 2019-06-25 11:26:17 +02:00
47d04c4af4 LANPR: Added collection target and related options. 2019-06-25 16:54:47 +08:00
5a4dd8f7b9 LANPR: make format 2019-06-25 16:21:03 +08:00
ce48510462 LANPR: Added collection tab and put collection specific LANPR settings in it. 2019-06-25 16:18:58 +08:00
c10f834b32 GPENCIL: Prevent sampling from crashing. Need a new implementation to calculate acturate segment count. 2019-06-25 14:33:07 +08:00
abecf82b6e GPENCIL: removed weights sample. Needs new implementaion. 2019-06-25 14:04:41 +08:00
be138d3380 LANPR: target GP material selection working 2019-06-25 13:44:44 +08:00
c0aae838ab LANPR: red-out modifier name when target is not set. 2019-06-25 13:25:36 +08:00
d0ea6e306c LANPR: filter GP targets only. 2019-06-25 13:24:35 +08:00
185d319ea3 LANPR: Comment changed into C style. 2019-06-25 12:39:39 +08:00
419837b680 Merge branch 'master' into soc-2019-npr 2019-06-25 12:15:12 +08:00
a0d1198a8d LANPR: Fix compiler issues
Yo need define the variable to copy and not the pointer array.

Also some clang format fixes done automatically by VS editor.
2019-06-24 15:51:47 +02:00
794da0fa14 GPENCIL: Sample function now handles weights as well. 2019-06-24 19:16:18 +08:00
5c7577f05b LANPR: fix error in GPencilModifierType. allocate for GPencil weights. 2019-06-24 17:15:35 +08:00
e3f606fa65 Merge remote-tracking branch 'origin/soc-2019-npr' into soc-2019-npr 2019-06-24 16:51:04 +08:00
6e1be5b09e LANPR: removed GP Stroke modifier, Object modifier now only create visible strokes and follow level values. 2019-06-24 16:49:04 +08:00
a86cbbfa51 LANPR: Apply clang format 2019-06-24 10:48:41 +02:00
f29cf28bab LANPR: Fix pointer mistakes. 2019-06-24 16:15:39 +08:00
45074ae36f LANPR: use "master style" instead of following contour style. 2019-06-24 09:23:50 +08:00
fd803aba5e GPENCIL: use copy_v3_v3 for gp points. 2019-06-24 08:35:30 +08:00
c2e7ef36d9 LANPR: make format 2019-06-23 18:01:07 +08:00
332423a7ca LANPR: two step chaining, need a toggle for switching 2d/3d space priority. 2019-06-23 18:00:03 +08:00
7799374520 LANPR: Fixed modifier read pointer error by providing foreachObjectLink() callback. 2019-06-23 16:11:21 +08:00
dc61580638 LANPR: modifier controlled stroke generation is working. (only manual) 2019-06-23 15:30:16 +08:00
1d532325bd LANPR: feature line modifier manual update 2019-06-23 14:28:29 +08:00
93f75be1ef GPencil: Remove Stencil for Background texture 2019-06-22 18:09:10 +02:00
e23ea999a6 Merge branch 'gp_stencil' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
	source/blender/draw/engines/gpencil/gpencil_engine.c
2019-06-22 17:55:05 +02:00
d1a5617c76 Merge branch 'master' into gp_stencil 2019-06-22 17:47:50 +02:00
31fb6c1d8f Merge branch 'master' into gp_stencil
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
	source/blender/draw/engines/gpencil/gpencil_engine.c
2019-06-22 16:56:25 +02:00
f30e4cd236 Merge branch 'master' into soc-2019-npr 2019-06-22 16:20:07 +08:00
b1bd4810b6 Merge branch 'master' into gp_stencil 2019-06-20 19:51:19 +02:00
2708515de7 Merge branch 'master' into gp_stencil 2019-06-20 16:32:29 +02:00
67e594ea7c Merge branch 'master' into gp_stencil 2019-06-20 13:44:21 +02:00
3af63f17c2 GPencil: Undo changes to use evaluated data in paint
There are problems when delete points and strokes and need a full redesign.
2019-06-20 13:37:49 +02:00
e8c17d9902 Merge branch 'master' into greasepencil-object 2019-06-20 09:36:12 +02:00
42e094bb3f Merge branch 'master' into gp_stencil 2019-06-20 09:35:36 +02:00
ec95642e6b Merge branch 'master' into GP_STENCIL 2019-06-19 20:04:02 +02:00
6e465c92da GPencil: Fix problem with several objects
The loop was not checking the end group of the object
2019-06-19 16:41:30 +02:00
ed00bc16a7 GPencil: Fix problem with several objects
The loop was not checking the end group of the object
2019-06-19 16:41:22 +02:00
0ac8ef1131 GPencil: Separate Stencils in groups of 255
Also some more changes to improve drawing.
2019-06-19 12:57:37 +02:00
15afcb6dd9 DRW: New functions for getting stencil_mask id
Workaround functions waiting for the clearing operation to be available inside the shgroups.

Required to check if the stencil was activated in the shading group to calculate batches of 255 stencil masks and reduce number of stencil clearing.
2019-06-19 12:57:31 +02:00
16279cbbba GPencil: Remove parameter and use Stencil for lines solid only
Also removed the parameter from UI
2019-06-19 12:57:16 +02:00
caa7c9a36f Merge branch 'master' into greasepencil-object 2019-06-19 12:56:55 +02:00
0738dac300 Merge branch 'master' into GP_STENCIL 2019-06-19 12:56:35 +02:00
1fe3139477 GPencil: Separate Stencils in groups of 255
Also some more changes to improve drawing.
2019-06-19 12:25:15 +02:00
08f6566dbf LANPR: Default values now in versioning_280.c 2019-06-19 18:17:20 +08:00
4be8461b88 LANPR: make format 2019-06-19 17:42:31 +08:00
ca0c24c9df LANPR: Manual stroke update functions. (Not working yet) 2019-06-19 17:41:02 +08:00
b5ea252ac3 LANPR: Chaining threshold parameter. Disabled LANPR composition operators. 2019-06-19 16:47:32 +08:00
e38a32e58a DRW: New functions for getting stencil_mask id
Workaround functions waiting for the clearing operation to be available inside the shgroups.

Required to check if the stencil was activated in the shading group to calculate batches of 255 stencil masks and reduce number of stencil clearing.
2019-06-19 09:30:50 +02:00
b165d0a414 LANPR: Removed "Tip Extend" data and properties. GP Modifiers will handle this. 2019-06-19 15:20:36 +08:00
dbb151c02b LANPR: modified default UI for more logical display. 2019-06-19 15:09:04 +08:00
e61479bcec Merge branch 'master' into GP_STENCIL 2019-06-19 08:56:17 +02:00
6e38e95b96 Merge branch 'master' into soc-2019-npr 2019-06-19 13:23:43 +08:00
6d88f8eaad GPencil: Remove parameter and use Stencil for lines solid only
Also removed the parameter from UI
2019-06-18 20:44:47 +02:00
7d15efec15 GPencil: Add a new parameter to material to disable Stencil
Sometimes is good to disable the stencil and get the overlap. With this parameter the artist has the option to disable it.
2019-06-18 19:31:18 +02:00
c2c6c62ea1 GPencil: Add a new parameter to material to disable Stencil
Sometimes is good to disable the stencil and get the overlap. With this parameter the artist has the option to disable it.
2019-06-18 19:24:36 +02:00
280135da56 GPencil: Disable Stencil for Fill while drawing 2019-06-18 18:05:22 +02:00
5be1adf12a GPencil: Disable Stencil for Fill while drawing 2019-06-18 18:05:06 +02:00
12b867cf66 GPencil: Disable Stencil for Dots while drawing 2019-06-18 18:01:47 +02:00
84666bdc3e GPencil: Disable Stencil for Dot while drawing 2019-06-18 18:00:19 +02:00
1ea17f5c9e GPencil: Disable Stencil for Dots and Fill shading groups
This types don't need stencil check because the stencil "kill" artistic effects.
2019-06-18 17:41:57 +02:00
2e15d015cd GPencil: Disable Stencil for Dots and Fill shading groups
This types don't need stencil check because the stencil "kill" artistic effects.
2019-06-18 17:41:25 +02:00
d4d92bff82 Basic Stencil working
Still not working the 255  layer separation
2019-06-18 17:31:25 +02:00
1243299bee LANPR: Added collection properties. 2019-06-18 18:28:36 +08:00
3f0c51c881 GPencil: Basic stroke stencil to avoid alpha glitches
Still not completed, but this commit fix the ugly artifacts in strokes with alpha when the stroke intersect itself. Now, the stroke only use the first pixel color and don't add blends.
2019-06-18 11:24:12 +02:00
4adfa653b5 Merge branch 'master' into greasepencil-object 2019-06-18 11:14:17 +02:00
a4287db20d LANPR: Fix smooth contour modifier merge errors. 2019-06-18 16:22:27 +08:00
1fb871e804 Merge remote-tracking branch 'DarkdefenderRepo/npr_tess' into soc-2019-npr 2019-06-18 16:09:44 +08:00
013c6d6c38 LANPR:Added option to use the same style for different line types 2019-06-18 15:53:21 +08:00
30b2db0be7 LANPR: Add enable and auto update switches 2019-06-18 15:00:28 +08:00
13cff0d524 LANPR: Move main panel to render tab 2019-06-18 13:36:49 +08:00
384d417f5f Merge branch 'master' into greasepencil-object 2019-06-17 10:22:49 +02:00
7cb674d521 LANPR: make format 2019-06-17 15:08:06 +08:00
915a928067 Merge branch 'master' into soc-2019-npr 2019-06-17 14:58:39 +08:00
fe71389950 LANPR: Object modifier for line selection (not functional yet) 2019-06-17 14:50:34 +08:00
c45cfec2fd Merge branch 'master' into greasepencil-object 2019-06-16 11:01:53 +02:00
f4ed032ad0 Merge branch 'master' into greasepencil-object 2019-06-15 09:11:00 +02:00
4f5f19c1a8 Merge branch 'master' into greasepencil-object 2019-06-14 20:10:38 +02:00
df385eb0a9 Merge branch 'master' into greasepencil-object 2019-06-14 10:12:35 +02:00
0d159bf74e LANPR: Removed duplicated code in stroke modifier. 2019-06-13 23:09:22 +08:00
40a12b4a38 LANPR: Fix pointer conversion for MSVC. 2019-06-13 22:33:04 +08:00
82c6ebee9a Merge branch 'master' into greasepencil-object 2019-06-13 13:51:58 +02:00
5d689428b3 Merge branch 'master' into greasepencil-object 2019-06-12 16:04:01 +02:00
e09dfe644b Merge remote-tracking branch 'origin/master' into soc-2019-npr
# Conflicts:
#	release/datafiles/locale
#	release/scripts/addons
#	release/scripts/addons_contrib
2019-06-12 21:35:05 +08:00
6034edfb41 LANPR: Use root bounding area to allow longer chaining (need workarounds.) 2019-06-12 21:33:27 +08:00
bc1b7a7af1 LANPR: Chain connection is now working properly 2019-06-12 21:05:53 +08:00
c8ad50a4e3 LANPR: Chain connection working. 2019-06-12 19:33:25 +08:00
668c15d5bf LANPR: Chain image space connection (not working yet) 2019-06-12 17:55:57 +08:00
212351ad78 Merge branch 'master' into greasepencil-object 2019-06-12 08:46:38 +02:00
0dd47056eb Merge branch 'master' into greasepencil-object 2019-06-11 11:06:11 +02:00
d251aaeebe LANPR: Shader free. 2019-06-11 12:04:54 +08:00
1d68941e3b Merge remote-tracking branch 'origin/master' into soc-2019-npr 2019-06-10 19:57:59 +08:00
f59db22f51 LANPR: Software mode now allows camera lens shift. 2019-06-10 19:52:20 +08:00
5e2fab456d LANPR: sample and batch pool goes to lanpr_share. 2019-06-10 17:17:29 +08:00
5d534f947d LANPR: hide render_buffer from SceneLANPR, implemented copy and free functions. No memory leaks on software mode now. 2019-06-10 16:15:11 +08:00
d1c4790d61 Merge branch 'master' into greasepencil-object 2019-06-10 08:39:03 +02:00
d6456466e9 LANPR: Renoved workbench engine registeration. Now LANPR registers correctly. Memory free working. 2019-06-10 13:52:43 +08:00
7e5eeeeb9c LANPR: Fixed DPIX object position error. 2019-06-09 17:32:33 +08:00
1eb0994d38 LANPR: Fixed triangle culling algorithm errors. 2019-06-09 14:50:44 +08:00
a6678bc637 Merge branch 'master' into greasepencil-object 2019-06-07 13:01:49 +02:00
ee28432848 Merge branch 'master' into greasepencil-object 2019-06-07 10:40:53 +02:00
a391719afd Merge branch 'master' into greasepencil-object 2019-06-05 15:59:20 +02:00
a4b0a65909 GPencil: Backbone Stretcher modifier 2019-06-05 12:20:48 +08:00
f8f010887b Merge remote-tracking branch 'origin/master' into soc-2019-npr 2019-06-05 11:09:28 +08:00
1816e1f9ae GPencil: Sample modifier OK. 2019-06-04 21:43:16 +08:00
c536d7b778 LANPR: Added a placeholder for GPencil sample modifier. 2019-06-04 18:31:09 +08:00
c610ea5ad0 Merge branch 'master' into greasepencil-object 2019-06-04 11:15:51 +02:00
fd9c100e59 GPencil: Fix compiler error after merge 2019-06-04 11:14:41 +02:00
7f1a9480fc LANPR: Fixed last segment missing error on chain splitting. 2019-06-04 16:41:12 +08:00
b7067088fe Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
2019-06-04 10:40:35 +02:00
cbc0c4846b LANPR: Split chains based on occlusion value changes. 2019-06-04 16:24:40 +08:00
f23223ee26 LANPR: Fixed last point occlusion error on "this line" chaining. 2019-06-04 14:48:05 +08:00
181e4ba1cf LANPR: Fixing chaining occlusion values for GPencil to use. 2019-06-04 13:48:40 +08:00
00202210ca Make LANPR main panel show in all engines. Fixed "up" button bug. Crease value now in software mode as well. 2019-06-04 12:47:54 +08:00
902c358932 Merge branch 'master' into soc-2019-npr 2019-06-04 12:15:43 +08:00
2897c90597 LANPR: rollback no-depth composition for GP, use object in front. Fixing chaining artefacts. 2019-06-03 18:28:09 +08:00
acc075f33c LANPR: GP stroke now automatically updates LANPR cache. 2019-06-03 17:49:24 +08:00
4cc1426783 LANPR: Memory now all in RenderBuffer->pool. engine_free() not called. 2019-06-03 16:28:29 +08:00
90137bbfa4 Fix chaining occlusion error and formatted source files. 2019-06-03 15:24:15 +08:00
bb48fcac2f Render data distroy functions 2019-06-03 15:06:32 +08:00
461008a3e8 Image and viewport now both support GPencil stroke overlay 2019-06-03 14:20:52 +08:00
dfbd3e4d9e Grease pencil composition depth option added. 2019-06-03 13:57:52 +08:00
bff6b5330f Merge remote-tracking branch 'origin/master' into soc-2019-npr 2019-06-03 12:06:09 +08:00
be9ef613fc Fixed smooth contour modifier not showing up bug. 2019-05-31 10:47:57 +08:00
b3d98f3532 Grease pencil conversion now projects onto 3D space now. Need perspective correction fix for cut points. 2019-05-31 10:20:35 +08:00
4f2b6c95fa Merge branch 'master' into soc-2019-npr 2019-05-31 08:12:45 +08:00
ecfe74cf74 Fix remaining pointer conversion errors for MSVC 2019-05-30 09:48:21 -06:00
25987fef1d Fix pointer conversion error for MSVC 2019-05-30 22:33:56 +08:00
413b2256d9 Spell check 2019-05-30 21:10:16 +08:00
daf3610a95 Merge remote-tracking branch 'origin/master' into soc-2019-npr 2019-05-30 19:22:46 +08:00
29f1a8f175 Added LANPR chain conversion funcitons. Now LANPR to GP is able to run. 2019-05-30 19:21:58 +08:00
1c2cda87b1 temporally add draw lib to gpencil modifier for lanpr 2019-05-30 16:11:46 +08:00
0d1bf0623b Adding lanpr to grease pencil strokes modifier. 2019-05-30 15:16:58 +08:00
200e5a77e2 Merge remote-tracking branch 'origin/master' into soc-2019-npr 2019-05-30 12:36:19 +08:00
5cfe6607d8 Remove obsolete memory pool 2019-05-30 12:35:16 +08:00
39ee04352d Merge branch 'master' into greasepencil-object 2019-05-29 16:54:15 +02:00
dac6485938 Merge remote-tracking branch 'origin/master' into soc-2019-npr
# Conflicts:
#	release/datafiles/locale
#	release/scripts/addons
#	release/scripts/addons_contrib
2019-05-29 16:23:33 +08:00
66f09eef29 Clean up of lanpr_util stuff. 2019-05-29 16:21:28 +08:00
6b9eb806dd Merge branch 'master' into greasepencil-object 2019-05-29 09:50:15 +02:00
14ffd94628 Finished structure naming convention changes in lanpr_all.h 2019-05-28 21:54:04 +08:00
28944549d6 Clang format the code. 2019-05-28 21:15:20 +08:00
19d3c5f9a6 Continue renaming structure variables. 2019-05-28 21:09:32 +08:00
37cc7063c7 Fixing LANPR structure naming to blender's style 2019-05-28 20:52:17 +08:00
847192b3d6 Use DRW_view APIs. (Potentially not doing it correctly.) 2019-05-28 16:32:11 +08:00
f37533fc44 Merge branch 'master' into soc-2019-npr 2019-05-28 15:39:42 +08:00
aa966ebf64 Merge branch 'master' into greasepencil-object 2019-05-27 16:26:14 +02:00
b50c7d7861 Merge branch 'master' into greasepencil-object 2019-05-27 10:14:06 +02:00
f78e1dea64 Merge branch 'master' into greasepencil-object 2019-05-26 16:24:51 +02:00
ef22ff0f79 GPencil: Redesign Grab evaluation transform calculation
Still problems with single points strokes
2019-05-23 17:01:14 +02:00
7acb5b91d5 GPencil: More test to apply evaluated rotation in Sculpt
This is an experimental commit
2019-05-23 12:55:14 +02:00
28748bb85c GPencil: Prepare data to calc transformation in derived data
This commits only prepares the information.
2019-05-22 10:52:09 +02:00
22c36bd7b3 Merge branch 'master' into greasepencil-object 2019-05-22 10:10:20 +02:00
fc0659a24b Merge branch 'master' into greasepencil-object 2019-05-21 20:26:00 +02:00
7155130911 GPencil: New function to get derived array
This utility is used to get the difference between original point and derived point
2019-05-21 19:52:59 +02:00
d5a8fe2282 Merge branch 'master' into greasepencil-object 2019-05-21 16:40:27 +02:00
6661855767 GPencil: Fix grab error in Sculpt with evaluated data 2019-05-21 16:13:57 +02:00
22768c2eff GPencil: Prepare fileds to implement Sculpt with eval data 2019-05-21 13:26:58 +02:00
2f3af2cc93 GPencil: Use evaluated data for Eraser
Now it's possible to erase an stroke in the position after applying a modifier. Before, this was not supported.
2019-05-21 12:42:59 +02:00
2b17ed31e2 Merge branch 'master' into greasepencil-object 2019-05-21 10:30:00 +02:00
76675d2eb7 Merge branch 'master' into greasepencil-object 2019-05-20 16:53:18 +02:00
4272fbae72 GPencil: Add multiframe support to reproject surface operator
This change solves T64814
2019-05-20 16:52:28 +02:00
f0e9ecd26b GPencil: Fix error in Multiedit
This error was related to the change to use depsgraph
2019-05-20 16:05:18 +02:00
Lukas W
0b8d2ab88c GPencil: Improve reproject operator in surface mode
See D4878 by  Lukas W (@geloescht)
2019-05-20 11:17:33 +02:00
69d338e254 Merge branch 'master' into greasepencil-object 2019-05-20 10:13:34 +02:00
a640228d92 Added support structure for material controlled line style.
Also with a primitive UI.
2019-05-19 14:37:03 +08:00
5b6b741ec0 Disable rendering of the orginal scene in the script. 2019-05-18 21:01:29 +08:00
abf50bc1db Merge branch 'master' into soc-2018-npr 2019-05-18 19:41:40 +08:00
78a8b208b7 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/makesdna/DNA_object_types.h
2019-05-17 10:45:23 +02:00
abe57249a5 GPencil: Fix crash adding new layer
The derived frame was not initializated to NULL.
2019-05-16 20:48:00 +02:00
818d2258b1 Merge branch 'master' into greasepencil-object 2019-05-16 20:13:31 +02:00
ba694d0e60 Merge branch 'master' into greasepencil-object 2019-05-16 16:17:51 +02:00
96caf9f4b7 Merge branch 'master' into greasepencil-object 2019-05-16 14:02:26 +02:00
e0dbedb708 GPencil: Apply Onion keyframe type to all modes 2019-05-16 13:43:40 +02:00
84f0aee3d7 GPencil: Change Onion key type filter to Range mode
The filter is more useful in this mode, not selected.
2019-05-16 13:38:23 +02:00
9faa0f7e6d GPencil: Remove animation for some properties 2019-05-16 12:15:25 +02:00
104c84a793 GPencil: New filter in Onion by keyframe type
This new filter allows to select only some type of keyframe (keyframe, breakdown, etc).

This was a request of artists that are used to work with other 2D softwares.
2019-05-16 12:03:56 +02:00
a0c890d3ef Merge branch 'master' into greasepencil-object 2019-05-16 12:03:28 +02:00
46866fb907 Solve merge errors in shader calls. 2019-05-16 10:03:21 +08:00
54804117e8 Merge branch 'master' into soc-2018-npr 2019-05-16 09:48:45 +08:00
f5e091095a Merge branch 'master' into greasepencil-object 2019-05-15 09:49:00 +02:00
21755dc610 Merge branch 'master' into greasepencil-object 2019-05-14 18:08:14 +02:00
c391f9daca Merge branch 'master' into greasepencil-object 2019-05-14 17:30:26 +02:00
977cfd62dc Merge branch 'master' into greasepencil-object 2019-05-14 16:32:33 +02:00
c15b10e227 Merge branch 'master' into greasepencil-object 2019-05-14 12:34:12 +02:00
6aa462128a Merge branch 'master' into greasepencil-object 2019-05-13 10:06:29 +02:00
5b2b1f053f Merge branch 'master' into greasepencil-object 2019-05-11 08:37:16 +02:00
cd82e3fcd4 Merge branch 'master' into greasepencil-object 2019-05-10 15:32:58 +02:00
c6acb31f70 Merge branch 'master' into greasepencil-object 2019-05-10 08:29:53 +02:00
fd9d4da257 GPencil: Fix errors after merge and minor cleanup 2019-05-09 13:36:21 +02:00
b914af26a2 Merge branch 'master' into greasepencil-object 2019-05-09 13:28:24 +02:00
ccd176046f GPencil: Move modifiers evaluation logic to Depsgraph (wip)
This commits is the first step to move all logic for evaluating modifiers to depsgraph evaluation and remove from the draw manager.  This was coded in the draw manager because when new grease pencil modules were written, the depsgraph was not ready.

Move all to depsgraph reduces the complexity of draw manager, and follows the standards for evaluated data.

This allows to use the evaluated data in edition modes.

Now, it's only working in selection operators, but in the future the different tools will work with the evaluated version and not with the original version as it was before.
2019-05-09 13:27:41 +02:00
767f1801fc Merge branch 'master' into greasepencil-object 2019-05-09 09:08:57 +02:00
bb0830816d Merge branch 'master' into greasepencil-object 2019-05-07 11:47:38 +02:00
2753611c4e Merge branch 'master' into soc-2018-npr 2019-05-06 10:09:12 +08:00
4a3fb26d34 GPencil: More code reorganization
Part of the reorganization to implement modifiers in Edit mode.
2019-05-04 10:59:35 +02:00
c6cf0b9999 GPencil: Move Runtime Cache data definition to BKE
This is the first step to prepare the code for using the modifiers data in Edit mode.
2019-05-04 10:52:37 +02:00
2c869e45c8 Merge branch 'master' into greasepencil-object 2019-05-03 18:44:05 +02:00
9a13815c49 Merge branch 'master' into greasepencil-object 2019-05-03 18:38:01 +02:00
3595919cba GPencil: Use default Brush material in Popover
For pinned materials, the stroke color must be the brush color, not selected slot.
2019-05-03 17:38:47 +02:00
8d6f4b75a7 GPencil: Change UI text 2019-05-03 10:29:24 +02:00
3928582d35 GPencil: Fix some errors in previous commit adding color to popover 2019-05-03 10:28:20 +02:00
3e7064f66e Merge branch 'master' into greasepencil-object 2019-05-03 10:16:50 +02:00
fc048122ce GPencil: Add Stroke Color to Popover panel 2019-05-03 10:16:19 +02:00
3d9bfd76b9 Merge branch 'master' into greasepencil-object 2019-05-03 09:49:27 +02:00
3947310ca8 Merge branch 'master' into greasepencil-object 2019-04-30 17:50:16 +02:00
f147becfd4 Merge branch 'master' into greasepencil-object 2019-04-29 16:25:16 +02:00
aafb17aeed Merge branch 'master' into greasepencil-object 2019-04-27 08:47:20 +02:00
abfd340bce Merge branch 'master' into greasepencil-object 2019-04-25 17:22:54 +02:00
eedb25087c Merge branch 'master' into greasepencil-object 2019-04-24 10:19:04 +02:00
fbb5edf974 Merge branch 'master' into soc-2018-npr
# Conflicts:
#	source/blender/blenloader/intern/readfile.c
2019-04-24 11:00:23 +08:00
cddccbc7b7 Merge branch 'master' into greasepencil-object 2019-04-22 17:30:18 +02:00
efcc83a07d Merge branch 'master' into soc-2018-npr 2019-04-22 09:46:20 +08:00
e630644fd4 Merge branch 'master' into greasepencil-object 2019-04-21 12:04:14 +02:00
2c5bce2300 Merge branch 'master' into soc-2018-npr Fix errors
# Conflicts:
#	intern/opensubdiv/internal/opensubdiv_evaluator.cc
#	intern/opensubdiv/internal/opensubdiv_evaluator_internal.cc
#	release/scripts/startup/bl_ui/properties_data_modifier.py
#	source/blender/CMakeLists.txt
#	source/blender/blenkernel/intern/scene.c
#	source/blender/blenloader/intern/readfile.c
#	source/blender/blenloader/intern/versioning_280.c
#	source/blender/blenloader/intern/writefile.c
#	source/blender/bmesh/intern/bmesh_polygon.c
#	source/blender/draw/CMakeLists.txt
#	source/blender/draw/intern/draw_manager.c
#	source/blender/draw/modes/object_mode.c
#	source/blender/editors/mesh/editmesh_tools.c
#	source/blender/editors/mesh/mesh_ops.c
#	source/blender/editors/render/render_intern.h
#	source/blender/editors/render/render_ops.c
#	source/blender/editors/space_outliner/outliner_draw.c
#	source/blender/editors/space_view3d/space_view3d.c
#	source/blender/makesdna/DNA_light_types.h
#	source/blender/makesdna/DNA_modifier_types.h
#	source/blender/makesdna/DNA_scene_types.h
#	source/blender/makesdna/intern/makesdna.c
#	source/blender/makesrna/intern/CMakeLists.txt
#	source/blender/makesrna/intern/makesrna.c
#	source/blender/makesrna/intern/rna_modifier.c
#	source/blender/makesrna/intern/rna_scene.c
#	source/blender/modifiers/CMakeLists.txt
#	source/blender/modifiers/intern/MOD_util.c
2019-04-20 14:10:24 +08:00
4d40187623 Merge branch 'master' into greasepencil-object 2019-04-19 10:30:11 +02:00
2a6abac705 Merge branch 'master' into greasepencil-object 2019-04-18 19:40:23 +02:00
fe9a87f879 Merge branch 'master' into greasepencil-object 2019-04-18 16:59:57 +02:00
4047ed1a9d GPencil: Add option to mix color with texture
This was already supported in Fill, but not in Strokes. This adds more artistic options when use textured strokes.
2019-04-18 14:29:19 +02:00
a656b6dacc Merge branch 'master' into greasepencil-object 2019-04-18 14:27:24 +02:00
0323111785 Merge branch 'master' into greasepencil-object 2019-04-18 09:47:43 +02:00
865bb3f948 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
	source/blender/draw/engines/gpencil/gpencil_engine.h
2019-04-17 18:09:12 +02:00
44acf0e331 Merge branch 'master' into greasepencil-object 2019-04-16 13:15:06 +02:00
24de946a4e GPencil: New Normalize All operator
This operator works similar to mesh operator but for Stroke and Points data.

Also minor cleanup in Normalize operator.
2019-04-16 12:12:35 +02:00
1fb43ba8c3 GPencil: Add lock icon to Vertex Groups list
Also check this flag in operators.

Note: This is required for the development of the new Normalize All operator.
2019-04-16 11:27:36 +02:00
565772bc70 GPencil: New Normalize Weights operator
This works similar to mesh operator, but using Stroke and Points data.
2019-04-16 10:47:30 +02:00
c85241bf32 Merge branch 'master' into greasepencil-object 2019-04-16 10:25:53 +02:00
2148ad3eb9 Merge branch 'master' into greasepencil-object 2019-04-15 16:45:08 +02:00
05db802421 Merge branch 'master' into greasepencil-object 2019-04-15 10:34:58 +02:00
2f36df9f37 Merge branch 'master' into greasepencil-object 2019-04-15 09:50:08 +02:00
ce90b6fb76 Merge branch 'master' into greasepencil-object 2019-04-13 13:33:51 +02:00
39ccfbc604 Merge branch 'master' into greasepencil-object 2019-04-13 11:21:37 +02:00
88928b6234 GPencil: Implement Opacity transform
Add Shift+F to transform points opacity in Edit mode
2019-04-13 10:48:53 +02:00
33a62c4277 GPencil: Add option to Follow Drawing Path
This option allows to enable or disable the automatic orientation of Dot and Box strokes.
2019-04-12 15:53:49 +02:00
8bfc689e83 Cleanup: Fix comment typo 2019-04-12 11:19:21 +02:00
d5b6f93523 Merge branch 'master' into greasepencil-object 2019-04-12 11:15:05 +02:00
dda2bdd819 GPencil: Improves Dot Texture rotation
Before when you use textures in a Dot stroke, the texture did not rotate with the stroke and always kept locked to North (0, 1).

Now, the rotation of the texture is calculated using the previous point to determine the direction of the stroke and rotate the texture following the drawing path.
2019-04-12 11:14:30 +02:00
11229c4d41 Merge branch 'master' into soc-2018-npr 2019-04-12 16:33:02 +08:00
e48795c20c GPencil: Cleanup unused shader variable 2019-04-11 18:31:00 +02:00
dfeb47e7ba GPencil: Cleanup unused vars 2019-04-11 18:06:16 +02:00
a27eb4dddb Merge branch 'master' into greasepencil-object 2019-04-11 16:37:07 +02:00
5740dc8f2a GPencil: Improve gradient stroke thickness
This change tries to improve the control of thickness when mix strength and gradient.
2019-04-10 20:01:25 +02:00
65d54f3023 GPencil: Replace gradient tooltip 2019-04-10 14:22:39 +02:00
30dea6af8d Merge branch 'master' into greasepencil-object 2019-04-10 10:42:52 +02:00
0c4144c472 GPencil: Improve Gradient in Dots mode
The old method was too complex and got weird results when mixed with brush strength. Now the result is far better.
2019-04-10 10:42:23 +02:00
39b32676d2 GPencil: Fix error with material context 2019-04-09 16:43:45 +02:00
ea90625acf GPencil: Active gradient only for DOTS 2019-04-09 16:25:04 +02:00
48bf837c8c GPencil: Disable gradient lines for Line strokes
Keep this disabled while the line glitch bug exists.
2019-04-09 16:01:14 +02:00
f415cbec5e Merge branch 'master' into greasepencil-object 2019-04-09 11:38:41 +02:00
c4fec789b2 GPencil: Remove Opacity parameter from Topbar 2019-04-09 11:30:15 +02:00
31066ef234 GPencil: Fix stroke opacity initialization 2019-04-08 17:22:48 +02:00
a016499d4a Merge branch 'master' into greasepencil-object 2019-04-08 16:32:00 +02:00
4f938d2cfe Merge branch 'master' into greasepencil-object 2019-04-07 17:05:26 +02:00
535899ae57 Merge blender2.8 into npr_tess 2019-04-05 23:38:45 +02:00
f1be941769 Merge branch 'master' into greasepencil-object 2019-04-05 18:29:11 +02:00
f1470a84f8 Fix modifier api 2019-04-04 21:57:00 +08:00
92a33e4599 Merge remote-tracking branch 'origin/master' into soc-2018-npr 2019-04-04 20:33:44 +08:00
47495f6f09 Fix errors 2019-04-04 20:33:16 +08:00
525c9034cd Merge remote-tracking branch 'origin/master' into soc-2018-npr
# Conflicts:
#	release/datafiles/locale
#	release/scripts/addons
#	release/scripts/addons_contrib
#	release/scripts/startup/bl_ui/properties_scene.py
#	source/blender/draw/intern/draw_manager_texture.c
#	source/blender/makesdna/DNA_scene_types.h
#	source/blender/makesrna/intern/rna_scene.c
#	source/tools
2019-04-04 19:14:41 +08:00
23c262192c Merge branch 'master' into greasepencil-object 2019-04-02 16:51:32 +02:00
dab0af9b0d Merge branch 'master' into greasepencil-object 2019-04-02 11:40:23 +02:00
6cf1f68725 Merge branch 'master' into greasepencil-object 2019-04-01 11:27:20 +02:00
5407c3a8b0 Merge branch 'master' into greasepencil-object 2019-03-30 11:37:22 +01:00
623b08d210 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2019-03-27 16:03:19 +01:00
1dbece8080 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2019-03-24 12:12:26 +01:00
46d35d00f6 Merge branch 'master' into greasepencil-object 2019-03-22 09:05:29 +01:00
a30dfaab64 Merge branch 'master' into greasepencil-object 2019-03-20 17:17:50 +01:00
24bab81d08 Merge branch 'master' into greasepencil-object 2019-03-19 16:25:10 +01:00
67143dba0d GPencil: Add gradient opacity parameter to topbar 2019-03-19 14:07:26 +01:00
12655c3590 GPencil: Cleanup unused code 2019-03-19 13:51:40 +01:00
b513f29a87 GPencil: Change Text for Gradient parameter 2019-03-19 13:49:41 +01:00
530d81c240 GPencil: More changes in gradient calculation for points 2019-03-19 13:44:24 +01:00
2ba4164072 GPencil: More changes to gradient factors 2019-03-19 12:27:58 +01:00
781a282caa GPencil: Pass gradient basic data to point shader 2019-03-18 11:04:31 +01:00
7f6d3d8fc4 GPencil: Add default gradient values to gizmo 2019-03-18 10:56:01 +01:00
bdbb0b0bd6 GPencil: Fix problem with gradient for Stroke and Monkey primitives 2019-03-18 10:53:15 +01:00
4ca31474ef GPencil: Pass basic data to shaders for gradients (wip) 2019-03-18 10:50:07 +01:00
dda3e48303 GPencil: Copy Brusg gradient data to stroke in drawing operators. 2019-03-18 10:29:13 +01:00
323ab6fdd7 GPencil: Set default gradient in new brushes 2019-03-18 09:06:11 +01:00
ac1adbc3f1 GPencil: New parameter for gradient
Add new fields and initialize.
2019-03-18 09:03:29 +01:00
13c1e7ffb7 Merge branch 'master' into greasepencil-object 2019-03-17 19:49:19 +01:00
738c8482de Merge branch 'master' into greasepencil-object 2019-03-17 15:56:55 +01:00
cf30fc24a8 GPencil: Reproject strokes to 3D cursor
Add a new option to reproject the strokes using the 3D cursor orientation.
2019-03-17 12:54:31 +01:00
9d13f18cce Merge branch 'master' into greasepencil-object 2019-03-17 09:38:31 +01:00
8ea91b34d7 GPencil: Back Canvas Grid to Draw position
Undo the previous commit and keep the Canvas in the position used in Draw mode. Change the position by mode looks strange.
2019-03-16 19:33:18 +01:00
df04d1242d Merge branch 'master' into greasepencil-object 2019-03-16 19:22:01 +01:00
9b50448e0d GPencil: Test the option to move the grid depending of mode. 2019-03-16 17:40:08 +01:00
4ee23876b5 Revert "GPencil: Show Canvas Grid only in Draw Mode"
This reverts commit a6ca1b27fb.
2019-03-16 17:15:05 +01:00
a6ca1b27fb GPencil: Show Canvas Grid only in Draw Mode
The grid is not used in Edit mode and in Sculpt mode the position depends of point, so the visual help is not valid.
2019-03-16 16:53:04 +01:00
4d390c2af6 Merge branch 'master' into greasepencil-object 2019-03-16 12:01:56 +01:00
c2fa4d18a0 GPencil: Fix compiler warning 2019-03-15 19:44:41 +01:00
3632e925c2 GPencil: Use the cursor lock in Sculpt mode
The point is locked to a plane with the last point and the normal of the cursor orientation.

The moved point is projected over the cursor/point plane and the closet point is used as result of the sculpt operation.
2019-03-15 19:36:34 +01:00
d4982f1911 GPencil: Canvas grid must be invisible for Stroke and Surface modes
In these modes, the grid is not used, so it's not logic show somthing that is not used.
2019-03-15 17:24:49 +01:00
0402db47b1 GPencil: Change cursor orientation Tooltip 2019-03-15 17:08:14 +01:00
fec90e08f7 Merge branch 'master' into greasepencil-object 2019-03-15 16:49:02 +01:00
6e8ac50dde GPencil: Improve origin location of new strokes
Before there was a mix between cursor and object origin. Now the origin is defined with one parameter and the lock defines the orientation.
2019-03-15 16:48:30 +01:00
cf5b7f97de Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_edit.c
	source/blender/editors/gpencil/gpencil_primitive.c
2019-03-15 10:10:27 +01:00
25b6802aca GPencil: Drawing locked to 3D cursor (wip)
Now it's possible to draw strokes attached to a plane locked to 3D cursor.

Still pending the lock in Sculpt mode.
2019-03-15 08:43:39 +01:00
f63255412f Merge branch 'master' into greasepencil-object 2019-03-14 19:54:31 +01:00
2bbcae2779 Merge branch 'master' into greasepencil-object 2019-03-14 19:50:24 +01:00
07c8f472cd GPencil: Cleanup unused shader code
After last changes, some code is not required and only adds noise lines.
2019-03-14 09:48:08 +01:00
b95c52d151 GPencil: Text flip vertical to texture stroke 2019-03-13 19:48:16 +01:00
11f5d0e339 GPencil: More test for textured strokes
Now the texture is inverted in alternate segments.
2019-03-13 16:36:08 +01:00
f3ee171917 Merge branch 'master' into greasepencil-object 2019-03-13 10:05:49 +01:00
712e898f28 Merge branch 'master' into greasepencil-object 2019-03-11 17:43:32 +01:00
55ca1d7c0e GPencil: Display color names only in Edit mode 2019-03-10 17:14:01 +01:00
bd4e21591b Merge branch 'master' into greasepencil-object 2019-03-10 16:53:25 +01:00
236353e385 GPencil: Add support to color names for selected strokes
When enable names display in object panel, the color of each selected stroke is displayed in the viewport near to the first selected stroke.
2019-03-10 16:52:43 +01:00
c7ce7f6f83 Merge branch 'master' into greasepencil-object 2019-03-08 22:09:50 +01:00
71e55d7a9a Merge branch 'master' into greasepencil-object 2019-03-08 19:55:53 +01:00
4bfe2a1638 Merge branch 'master' into greasepencil-object 2019-03-08 16:15:41 +01:00
a08bf336f5 Type error 2019-03-08 19:58:41 +08:00
c46ce1bc81 Merge changes 2019-03-08 19:39:02 +08:00
26fc7ef55f Merge branch 'master' into soc-2018-npr
# Conflicts:
#	release/datafiles/locale
#	release/scripts/addons
#	release/scripts/addons_contrib
#	source/blender/draw/intern/DRW_render.h
#	source/blender/makesdna/DNA_light_types.h
#	source/blender/makesdna/DNA_scene_types.h
#	source/blender/makesrna/intern/rna_scene.c
#	source/tools
2019-03-08 19:12:37 +08:00
51db1be858 GPencil: More test to textured strokes
Now, the UV is inverted by section (a full texture width) and not by point.
2019-03-08 10:24:54 +01:00
5a2e6d1a2f GPencil: Fix error after merge
Missing field rename.
2019-03-08 10:04:01 +01:00
3ff6b1b79e Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2019-03-08 08:44:03 +01:00
afbe476aa7 Merge branch 'master' into greasepencil-object 2019-03-07 19:16:08 +01:00
5b627da8ad GPencil: Invert texture UV for textured strokes
More test with textures to invert the UV depending of the random rotation.
2019-03-07 10:05:37 +01:00
f1966fae33 GPencil: Try to add some randomness to textured strokes
This is a test to check the sclae of the random value for UV in strokes.
2019-03-06 19:47:17 +01:00
3d60d3eb22 Merge branch 'master' into greasepencil-object 2019-03-06 19:31:38 +01:00
fe436f279c Merge branch 'master' into greasepencil-object 2019-03-06 19:23:24 +01:00
995113925f Merge branch 'master' into greasepencil-object 2019-03-06 16:26:30 +01:00
9c14b2442e Merge branch 'master' into greasepencil-object 2019-03-05 12:13:40 +01:00
10c15f2778 Merge branch 'master' into greasepencil-object 2019-03-04 20:57:35 +01:00
341d5f4cff Annotations: Reduce smooth factor to 0.5
The previous value was too high and deform too much if write text.
2019-03-04 20:38:03 +01:00
e897ec1295 Merge branch 'master' into greasepencil-object 2019-03-04 19:41:20 +01:00
46b6c97737 GPencil: Add a comment to tag pending change in gizmo
This comment is to tag this line to be removed when OB_MODE_EDIT_GPENCIL will be merged into OB_MODE_EDIT.
2019-03-04 19:28:35 +01:00
1d903d490b GPencil: Move Extrude Toolbutton to bottom group 2019-03-04 19:24:42 +01:00
8f6ef7563a GPencil: Add multiframe support to Extrude operator 2019-03-04 17:43:49 +01:00
2028ca8426 Merge branch 'master' into greasepencil-object 2019-03-04 17:32:55 +01:00
d56f4f55b1 GPencil: New extrude operator
If the extrude points are the first or last of the stroke, the stroke is extended.

If the extrude points are in the middle of the stroke, a new stroke is created because the grease pencil strokes can be only with 2 extremes.

Still pending define a new icon and set by default XYZ axis in gizmo.
2019-03-03 16:35:54 +01:00
283b516d88 Merge branch 'master' into greasepencil-object 2019-03-03 16:33:17 +01:00
fb0f740f81 GPencil: Fix merge error 2019-03-01 20:58:03 +01:00
89bb36edc6 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_engine.c
2019-03-01 20:55:19 +01:00
a001cdb3ad GPencil: Fill: UI Tweaks 2019-03-01 15:44:24 +00:00
aac875421f GPencil: Fill changes
+ Replace Strokes with Adaptive
+ Remove dilate option, always on
+ UI changes
2019-03-01 13:29:04 +00:00
34b32fbd2c GPencil: Fix merge error 2019-02-28 16:16:51 +01:00
63ea3ffa26 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_engine.c
	source/blender/draw/engines/gpencil/gpencil_engine.h
	source/blender/draw/engines/gpencil/shaders/gpencil_zdepth_mix_frag.glsl
2019-02-28 16:13:26 +01:00
07c6221925 GPencil: Rename variable name and add alpha to outline
The outline now has some alpha to be more consistent with other Blender areas.
2019-02-28 16:11:30 +01:00
a030e2fa15 GPencil: Disable Outline if Overlay is disabled
The main overlay switch and outline option must be checked.
2019-02-28 15:58:03 +01:00
8388f4b985 GPencil: Remove comment line added by error to header text
This line was added accidentally in the header text.
2019-02-28 12:23:58 +01:00
345ab3ab70 GPencil: Increase outline to 2 pixels
The selection outline of 1 pixel was too thin.
2019-02-28 12:12:52 +01:00
834942d121 GPencil: Hide selecction outline when play animation 2019-02-28 11:45:23 +01:00
770239fe61 GPencil: Draw Outline to Active and Selected objects
Now an outline is drawn when the grease pencil is selected.
2019-02-28 11:16:35 +01:00
ad9922516a GPencil: Remove dummy marker for Grease Pencil objects
After adding selecction using strokes, the dummy is not required because it was added as a provisional solution while we implement stroke selection.
2019-02-28 11:16:29 +01:00
db6fb2a719 GPencil: Add selection support for objects using strokes
Now it's possible to select a grease pencil object without using the dummy.
2019-02-28 11:16:24 +01:00
18c43863f4 GPencil: Draw Outline to Active and Selected objects
Now an outline is drawn when the grease pencil is selected.
2019-02-28 10:47:57 +01:00
370d6293dc GPencil: Remove dummy marker for Grease Pencil objects
After adding selecction using strokes, the dummy is not required because it was added as a provisional solution while we implement stroke selection.
2019-02-27 20:46:04 +01:00
0b0bda3860 GPencil: Add selection support for objects using strokes
Now it's possible to select a grease pencil object without using the dummy.
2019-02-27 19:50:58 +01:00
21bcc58c88 Merge branch 'master' into greasepencil-object 2019-02-27 19:50:10 +01:00
bb9422ec82 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_edit.c
	source/blender/makesdna/DNA_brush_types.h
	source/blender/makesrna/intern/rna_brush.c
2019-02-27 16:32:47 +01:00
0425686754 Merge branch 'master' into greasepencil-object 2019-02-26 14:05:30 +00:00
7809ef8c57 Merge branch 'master' into greasepencil-object 2019-02-25 17:52:07 +01:00
6bebb39c1c Merge branch 'master' into greasepencil-object 2019-02-25 08:35:50 +01:00
c26ab6fe15 Merge branch 'master' into greasepencil-object 2019-02-23 11:49:48 +01:00
50293fd251 GP: Change Draw Mode Title 2019-02-22 14:35:20 +01:00
cd68ef4803 GP: Reorganize Draw Mode
Now, the parameter only works with 3D space depth ordering. The Back and Front depths are incompatible with 3D Space mode.

Options are:
- Back
- Front
- 3D Space->2D Layers (default)
-3D Space->3D Space (new mode)
2019-02-22 09:12:22 +01:00
70c511cecb GP: Cleanup style 2019-02-21 12:35:29 +01:00
2d7c903512 Merge branch 'master' into greasepencil-object 2019-02-21 12:28:39 +01:00
333f562cf7 GP: Define new Draw Mode
Add a new Draw Mode to display panel in order to define the z-.depth order of the strokes using the real 3D position and not the 2D layer position.

This change makes possible to use VR with grease pencil drawings because the depth of the strokes change with camera position.
2019-02-21 12:27:43 +01:00
14cd89149a Merge branch 'master' into greasepencil-object 2019-02-19 17:41:00 +01:00
5a3095ffb7 Merge branch 'master' into greasepencil-object 2019-02-17 12:22:20 +01:00
4f04859237 Merge branch 'master' into greasepencil-object 2019-02-14 23:04:15 +01:00
d1067b645d GP: Fill: Fix issue with textured strokes
Force textured strokes to use control lines for the fill boundary regardless of fill mode.
2019-02-14 11:10:39 +00:00
4311346e29 Merge branch 'master' into greasepencil-object 2019-02-14 10:03:28 +01:00
48355d7430 GP: Trim Strokes: UI Changes
+ Fix inner loop
2019-02-11 13:54:01 +00:00
3013afcc1e Merge branch 'master' into greasepencil-object 2019-02-09 19:09:52 +01:00
5f52ea5218 Merge branch 'master' into greasepencil-object 2019-02-07 16:32:47 +01:00
6535ce6e61 Merge branch 'master' into greasepencil-object 2019-02-07 15:37:53 +01:00
cee3b7b2d9 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_render.c
2019-02-06 10:02:51 +01:00
856ad07a71 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/makesrna/intern/rna_brush.c
2019-02-05 12:10:56 +01:00
41f2a8c861 GP: Cleanup blend render functions
This is the first step to try to fix the problems with colors.
2019-02-04 20:01:20 +01:00
7a6daa6b26 Merge branch 'master' into greasepencil-object 2019-02-02 09:34:05 +01:00
5aee6cbcbb Merge branch 'master' into greasepencil-object 2019-02-01 17:15:36 +01:00
53586f3fb2 Merge branch 'master' into greasepencil-object 2019-01-30 16:36:14 +01:00
d4eafa06a1 GP: Test for removing DEG_get_original_id()
Use depsgraph data and not original data in draw manager, except while drawing new strokes.
2019-01-29 17:19:02 +01:00
5bda55aec9 Merge branch 'master' into greasepencil-object 2019-01-29 16:34:20 +01:00
16eacc9196 Merge branch 'master' into greasepencil-object 2019-01-28 17:27:37 +01:00
eff62db361 Merge branch 'master' into greasepencil-object 2019-01-27 19:29:40 +01:00
685909272f Merge branch 'master' into greasepencil-object 2019-01-26 10:57:56 +01:00
e633707e0f Merge branch 'master' into greasepencil-object 2019-01-25 20:45:51 +01:00
b6fc2f1e12 Merge branch 'master' into greasepencil-object 2019-01-25 10:08:31 +01:00
67b31124e8 Merge branch 'master' into greasepencil-object 2019-01-24 18:36:05 +01:00
b0f8331b78 GP: Move trim to shared module and cleanup
- Moved trim function to shared BKE.
- Add support to multi frame edit.
- Cleanup debug code.
2019-01-24 18:12:05 +01:00
f6c25ed3ba GP: Draw: Stroke Trim
+ New 'Trim' edit mode operator and post-processing brush option.

Trim works on a single GP stroke. It removes trailing points before and after the first intersection (or loop) nearest to the start of the stroke.
2019-01-24 15:57:02 +00:00
1af7837e6d Merge branch 'master' into greasepencil-object 2019-01-23 13:40:28 +00:00
0d9e6c5acd Merge branch 'master' into greasepencil-object 2019-01-22 20:17:24 +01:00
bd5200f18f Merge branch 'master' into greasepencil-object 2019-01-22 17:56:00 +01:00
746d1904fe Merge branch 'master' into greasepencil-object 2019-01-21 19:14:14 +01:00
1651f53276 Merge branch 'master' into greasepencil-object 2019-01-21 15:03:19 +00:00
ca6b2bdc17 Merge branch 'master' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/properties_paint_common.py
2019-01-21 11:05:58 +01:00
5cba4e1cb6 Merge branch 'master' into greasepencil-object 2019-01-20 20:41:25 +01:00
8c48e8d805 Merge branch 'master' into greasepencil-object 2019-01-19 14:34:40 +00:00
7625771e3e GP: Fill: Add end cap support to boundary strokes
+ Fill boundary stroke supports end caps
+ Fix pixfactor type
2019-01-19 02:24:43 +00:00
9e28e409bc Merge branch 'master' into greasepencil-object 2019-01-18 15:51:31 +00:00
022eca106e Merge branch 'master' into greasepencil-object 2019-01-18 10:56:44 +01:00
fedb278d31 GP: Fill: Temp fix for fill options in topbar
Topbar has a bug that means if there are too many items it won't display them.
This temp fix moves some of the Fill tool options to a popup panel.
2019-01-18 09:22:31 +00:00
5abe5050ed GP: Fix Fill Topbar
The column layout is not supported as expected.

Anyway, there is a bug in topbar when the size of the parameters is too big.
2019-01-17 20:34:39 +01:00
b4a172fe59 Merge branch 'master' into greasepencil-object 2019-01-17 19:34:19 +01:00
5f76b766d4 GP: Fill: Tweaks
+ Made Dilate an option for all fill modes for testing purposes
+ Pixel shift is enabled for all modes
2019-01-17 11:57:27 +00:00
171861eb5e Merge branch 'master' into greasepencil-object 2019-01-16 20:05:37 +01:00
c6467c3c4f Merge branch 'master' into greasepencil-object 2019-01-16 19:23:08 +01:00
9d5bae9d09 GP: Fill: Dilate into corner pixels
Dilate now fills corner pixels for more accuracy.

Devs: Not sure that the algorithm is the most efficient so if you have any tips let me know!!!
2019-01-16 17:44:27 +00:00
5cdd1d901b GP: Fill: Fix issue with dilate creep 2019-01-16 15:14:09 +00:00
4ca6d8e9d8 GP: Use multiframe falloff in Shear transform 2019-01-16 11:30:06 +01:00
efec93974e GP: Use multiframe falloff for Bend transformation 2019-01-16 11:25:12 +01:00
46f0093be3 GP: Fill: Adaptive mode
+ add naive dilate to filled area
+ shift points by half pixel
2019-01-15 21:40:43 +00:00
0fa111e74f Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_fill.c
2019-01-15 19:45:14 +01:00
1d2cb649f7 GP: Fill: New mode, adaptive
This is like both strokes and control mode but with narrower strokes.
2019-01-15 15:08:20 +00:00
6871f7bca2 GP: Fill: Reduce stroke thickness to minimum
Sets flag when using the fill tool to reduce strokes to minimum. This helps reduce white areas.
2019-01-14 23:03:16 +00:00
5e5496e6ea GP: Fill: Fix crasher when unable to create GPUOffScreen 2019-01-14 22:39:01 +00:00
fe570a2fea GP: Fill: Add Resolution multiplier
Default is 1, no change. Increasing this number improves accuracy at the expense of processing time and memory usage.

This value multiplies the resolution of the buffer image generated used to calculate the flood fill.
2019-01-14 19:03:47 +00:00
f49c07aaa7 Merge branch 'master' into greasepencil-object 2019-01-14 18:00:59 +00:00
76bcef3c98 Merge branch 'master' into greasepencil-object 2019-01-11 19:23:09 +01:00
e6cd8294d9 Merge branch 'master' into greasepencil-object 2019-01-11 18:56:47 +01:00
f7e1904f08 Merge branch 'master' into greasepencil-object 2019-01-11 16:59:25 +01:00
a5b1305cf2 GP: Guides: Set status back to idling after exiting cp mode 2019-01-11 15:31:38 +00:00
98542acb4f Merge branch 'master' into greasepencil-object 2019-01-11 11:01:07 +01:00
b6a09a0ff6 Merge branch 'master' into greasepencil-object 2019-01-11 10:26:46 +01:00
a99886d55c GP: Guides: Fix snapping distance
Use pre-existing code to determine the pixel scale.
2019-01-10 23:46:27 +00:00
cbc2c91356 Merge branch 'master' into greasepencil-object 2019-01-10 16:26:40 +01:00
89281f0dd8 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
2019-01-10 13:17:31 +01:00
60cd64fe2e Merge branch 'master' into greasepencil-object 2019-01-09 16:44:38 +01:00
c863ad1a85 Merge branch 'master' into greasepencil-object 2019-01-08 16:55:32 +01:00
23aae7822b GP: If no collision restore selection of points
If no collision, the selection only selected the vertex as vertex mode and don't extend selection.
2019-01-08 11:26:22 +01:00
bdbc0f184f GP: Remove with Cutter strokes of 2 points
As thess strokes always generate an autocollision, it was impossible to delete them.
2019-01-08 11:16:59 +01:00
ee672ad4ea Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_paint.c
2019-01-08 09:28:08 +01:00
56a829145b GP: Guides: Change keys to release event 2019-01-08 00:41:02 +00:00
bc859fadad GP: Guides: Change units from px to blender
Based on GP team feedback

+ Tidy and also fix issue of not snapping to nearest guide
2019-01-08 00:26:26 +00:00
e6296a54f2 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/makesdna/DNA_gpencil_types.h
	source/blender/makesdna/DNA_scene_types.h
2019-01-07 19:05:48 +01:00
6d6985ff84 GP: Support Cutter in same stroke
Before the cutter only worked with different strokes, but now can handle selfcollisions.

Also added code to avoid infinite loops.
2019-01-07 18:43:49 +01:00
b21bb283b5 GP: Guides: UI Cleanup
Remove enable option from menu
Remove cursor location
2019-01-07 15:17:24 +00:00
3331c73564 GP: Cleanup compiler warnings 2019-01-07 16:12:28 +01:00
74f39165fd GP: Cleanup - Remove commented UI code 2019-01-07 10:08:30 +00:00
607e542087 Merge branch 'master' into greasepencil-object 2019-01-07 10:43:53 +01:00
bddb1c0f4d GP: Cleanup typo error 2019-01-07 10:42:47 +01:00
1d3d48fa4d GP: Cleanup - Move Guides RNA to separated function 2019-01-07 10:34:31 +01:00
431e7349e7 GP: Guides: Speedline drawing guides
Initial commit for final testing
2019-01-06 23:07:43 +00:00
014c2d5e03 GP: Rename Solo Mode property 2019-01-06 17:26:43 +01:00
38f844c078 Merge branch 'master' into greasepencil-object 2019-01-06 17:22:59 +01:00
c78fbccee8 GP: Set Cap mode as Enums
Now the Cap mode is an enum ready for future modes.

Add the cap mode to material is not logic because the stroke start and end depends on the drawing direction. Maybe in the future we could add to material, but will need more work at stroke level.

The Toggle operator keeps equal in a circular switch mode. We can improve it also in the future.
2019-01-06 16:41:02 +01:00
f51c34ec59 GP: Move Solo Mode to Layer level
WIP: Still pending the final UI location and name.
2019-01-06 16:12:39 +01:00
8e62b8907d GP: New Solo Mode to display keyframes only
When paint mode, now is possible display only layers with keyframes in the current frame.

This is very useful to fill strokes.
2019-01-05 19:44:40 +01:00
3c8cc073ad Merge branch 'master' into greasepencil-object 2019-01-05 19:03:17 +01:00
13fedec4ab GP: Allow different cap shape in each extrem of the stroke 2019-01-05 16:38:04 +01:00
ef57bc2d5f GP: New option to toggle Caps mode
Now it's possible to have flat or rounded (default) stroke caps.

The operator is accessible in edit mode.
2019-01-05 12:22:00 +01:00
d0da9054c6 Merge branch 'master' into greasepencil-object 2019-01-05 11:10:53 +01:00
0ed55524f1 Merge remote-tracking branch 'origin/master' into soc-2018-npr
# Conflicts:
#	release/datafiles/locale
#	release/scripts/addons
#	release/scripts/addons_contrib
#	source/blender/makesdna/DNA_scene_types.h
#	source/blender/makesrna/intern/rna_scene.c
#	source/tools
2019-01-05 17:29:09 +08:00
516019bc72 GP: Rename isect property 2019-01-05 09:06:30 +01:00
e6a9af4427 GP: Add Keymap for segment mode 2019-01-05 09:06:17 +01:00
6d92338179 GP: Remove hardcode factor for cutter point
This made the intersection to be over original point.
2019-01-04 22:19:13 +01:00
87ca0afe81 GP: Initialize intersection threshold 2019-01-04 20:18:13 +01:00
d2d2d2416b Merge branch 'master' into greasepencil-object 2019-01-04 18:16:34 +01:00
682ba1d001 GP: Minor threshold tweaks 2019-01-04 18:15:57 +01:00
eba3cb75b0 GP: Improve intersections and add Threshold parameter
Now the threshold can be defined using a UI parameter.

The parameter is available in Edit selecction and in Cutter tool.

Also improved the use of this threshold.
2019-01-04 17:52:29 +01:00
b2df4c5d5b GP: Cleanup code 2019-01-04 10:43:35 +01:00
ebf98b4c05 Revert "GP: Draw: Speedline guides"
This reverts commit e83bfeab81.
2019-01-04 10:31:58 +01:00
e48c4638f8 Merge branch 'master' into greasepencil-object 2019-01-04 10:29:45 +01:00
d337a3993b Merge branch 'master' into greasepencil-object 2019-01-03 20:14:33 +01:00
5c14270fd8 GP: Add small offset to collision point 2019-01-03 20:09:21 +01:00
c3f971fc10 GP: Fix segment fault whith Cutter
The problem was when the new intersection point was inside the lasso.

Also improved when select all stroke points.
2019-01-03 19:50:21 +01:00
6bc549d40d Merge branch 'master' into greasepencil-object 2019-01-03 16:49:26 +01:00
ba5a8d5992 GP: Improve collision detection
Now the stroke extremes are scaled for improving the collision detection.
2019-01-03 16:41:22 +01:00
fd552a77d7 Revert "GP: Remove correction factor in Cutter"
This reverts commit c05ac7bc58.
2019-01-03 13:58:33 +01:00
78994637ca GP: Fix problem when select same stroke several times 2019-01-03 13:47:27 +01:00
2648ef562b GP: Hide topbar options for Cutter 2019-01-03 12:12:56 +01:00
c808e33461 GP: Add Lasso Eraser to Cutter tool 2019-01-03 12:03:46 +01:00
b02d985ce3 Merge branch 'master' into greasepencil-object 2019-01-03 11:30:35 +01:00
950dc276a7 Merge branch 'master' into greasepencil-object 2019-01-03 10:52:12 +01:00
1d3aedfb2e GP: Fix segment fault using cutter
The layer can be empty without frames.
2019-01-03 10:50:50 +01:00
d99b647015 Merge branch 'master' into greasepencil-object 2019-01-02 19:56:27 +01:00
dc8eb55390 GP: Basic Lasso Cutter support 2019-01-02 19:40:30 +01:00
c05ac7bc58 GP: Remove correction factor in Cutter
This factor makes better cuts, but breaks other cuts, so the next operation is not working.

Maybe in the future we can add this as a parameter.
2019-01-02 19:40:30 +01:00
e83bfeab81 GP: Draw: Speedline guides
Initial commit for artist feedback.
Provides drawing guides or constraints for drawing lines.

Notes:
UI Panel in 3D view. Some settings only have keyboard access at the moment.
Alt-C: Screen space position of circular guide
C: Circular guide
L: Parallel line guide
M: Flip direction 90° degrees
V: Freehand mode (turn off)
J/K: For line guide, rotate guide (alt 45°, shift 15°)
Alt-L: Set angle to that of the last stroke (useful to align to freehand strokes)
Ctrl-L: Set angle to 0°

Todo:
On screen guidelines
2019-01-02 17:57:07 +00:00
0ab64a9297 Merge branch 'master' into greasepencil-object 2019-01-02 17:44:38 +01:00
63e34ee641 Merge branch 'master' into greasepencil-object 2019-01-02 10:19:22 +01:00
e5b7ebf71f GP: Fix possible NULL error 2019-01-02 10:05:38 +01:00
8d78a25ef4 Fixed clipping distance calculation, but clip plane triangle cutting still have problems. 2019-01-02 16:09:01 +08:00
27eb5c231e Merge branch 'master' into greasepencil-object 2019-01-01 17:42:23 +01:00
960455b232 GP: New Cutter tool
This tool is used to cut the extremes.
2019-01-01 17:41:09 +01:00
cd07dd2a1c GP: New Segment selection mode
New option to select points between stroke collision. This is useful to select the segment between two strokes to make merges.
2018-12-30 22:10:50 +01:00
fc23d501d3 Merge branch 'master' into greasepencil-object 2018-12-30 13:09:17 +01:00
13df6fb776 Merge branch 'master' into greasepencil-object 2018-12-30 12:49:05 +01:00
907ea48a52 Fixed intersection missings when bounding area separation occurs. 2018-12-30 11:28:36 +08:00
fd49ce1d7b Fixed hidden multi-thread error. 2018-12-29 21:31:32 +08:00
5ded8bc95f Fix triangle-point test function for a stupid condition. See comment. 2018-12-29 15:05:41 +08:00
628ff9b3d6 make rendering into a loop to avoid callback stack overflow. 2018-12-29 13:04:22 +08:00
a531f8528b remove INVOKE_DEFAULT for rendering, otherwise still cause trouble on windows. 2018-12-29 12:28:10 +08:00
a3b17a6c71 Fix scripts from external editings. 2018-12-28 21:49:50 +08:00
7d60b14676 Added one click composition to LANPR. 2018-12-28 21:20:19 +08:00
8ac8cb9ce1 GP: fix error after merge 2018-12-28 10:48:45 +01:00
e1aaeaf27e Merge branch 'master' into greasepencil-object 2018-12-28 10:42:48 +01:00
736bb18666 GP: Fix error when merge 1 stroke only 2018-12-28 10:41:27 +01:00
be0628b743 Merge branch 'master' into soc-2018-npr 2018-12-28 10:59:36 +08:00
28e2e688d9 GP: More cleanup and renames 2018-12-27 22:29:36 +01:00
b60e45164d GP: Remove unused variable 2018-12-27 22:22:06 +01:00
a5d66391ab GP: Mew Merge Strokes operator
This operator allows to create a new stroke joining several stroke selected points of different strokes.

The new stroke will use the current material.

To use, first select the points to be merged. Optionally can remove the old points and strokes.

The operator is available in Edit mode in the Specials menu and Stroke menu.
2018-12-27 17:48:28 +01:00
c68996c75a Merge branch 'master' into greasepencil-object 2018-12-27 17:07:22 +01:00
039af4f45c Merge branch 'master' into greasepencil-object 2018-12-25 11:11:09 +01:00
acb1f24178 GP: Remove temporarily chord primitive
As this primitive is not defined completely, we remove it now and we can add later. Keep this primitive in the source code can produce errors when move more stable options to master.
2018-12-25 10:47:02 +01:00
537b6681d8 Merge branch 'master' into greasepencil-object 2018-12-25 10:28:10 +01:00
be72963cc8 Merge branch 'master' into greasepencil-object 2018-12-24 11:18:15 +01:00
d28d0e4416 Merge branch 'master' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_intern.h
	source/blender/editors/gpencil/gpencil_primitive.c
2018-12-23 16:58:25 +01:00
Nick Wu
61d3c1261c Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-12-23 19:09:42 +08:00
4e84dd7106 Merge branch 'master' into greasepencil-object 2018-12-21 18:55:55 +01:00
22f1cb2121 Merge branch 'master' into greasepencil-object 2018-12-21 16:27:31 +01:00
9c91e6c857 GP: Primitive: Fix randomness bias 2018-12-21 12:19:41 +00:00
56873ae4fd GP: Primitive: Fix merge errors 2018-12-21 09:29:16 +00:00
c8f72541b6 Merge branch 'blender2.8' into greasepencil-object 2018-12-21 08:47:53 +01:00
93a341526c Merge branch 'blender2.8' into greasepencil-object 2018-12-20 17:39:35 +01:00
0a795fa99c GP: Fix merge conflict 2018-12-20 15:53:36 +01:00
2cc269fe8f GP: Fix merge error 2018-12-20 14:00:28 +01:00
f9a8662938 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_primitive.c
2018-12-20 13:36:41 +01:00
ef757a2ef8 GP: Primitive: Fkey to size brush 2018-12-20 11:45:51 +00:00
8d599e1e67 GP: Primitive: Add MMB to confirm 2018-12-19 15:33:24 +00:00
761c937a8e GP: Primitive: RMB does not cancel previous strokes
Based on GP team feedback.
2018-12-18 16:17:38 +00:00
05cb3fe584 GP: Primitive: Fix flickering when using a noise brush
Previously, the random values were generated every draw, now they are generated once.
2018-12-18 14:26:53 +00:00
90875f7d94 Merge remote-tracking branch 'origin/blender2.8' into soc-2018-npr
# Conflicts:
#	source/blender/makesdna/DNA_lamp_types.h
#	source/blender/makesdna/DNA_scene_types.h
2018-12-18 11:56:01 +08:00
6dfc7969f5 Merge branch 'blender2.8' into greasepencil-object 2018-12-17 19:14:30 +01:00
b4d0795be5 Merge branch 'blender2.8' into greasepencil-object 2018-12-17 18:35:43 +01:00
77b9002fa0 GP: Primitive: Chord shape
Similar to Arc but based on a chord. Can create bulbous curves.
2018-12-17 17:02:33 +00:00
ecfcb3948a Merge branch 'blender2.8' into greasepencil-object 2018-12-17 11:45:27 +01:00
b5c754ba11 Merge branch 'blender2.8' into greasepencil-object 2018-12-16 12:24:07 +01:00
e54e69764e Merge branch 'blender2.8' into greasepencil-object 2018-12-16 11:41:46 +01:00
e66165e0a3 Merge branch 'blender2.8' into greasepencil-object 2018-12-15 17:22:42 +01:00
ba9faca2a6 GP: M key only must works for Arcs 2018-12-15 16:57:38 +01:00
c29cb2a88a GP: Remove L keymap
Change the Tool using a keymap is not the best solution. The right way is use a different tool.
2018-12-15 16:37:02 +01:00
f6ecefa675 GP: Make C key works only with curves
If we enable this key in Arc it looks the curve and Arc and the same tool, but they are different, so to change the tool use toolbar not a keymap.
2018-12-15 16:35:02 +01:00
21df096161 GP: Change F keymap to M keymap
F means fill, M for mirror is better.
2018-12-15 16:27:56 +01:00
d1da89f73e GP: Replace A keymap by E keymap to be consistent. 2018-12-15 16:22:59 +01:00
50668ae249 GP: Remove C key for Line primitive
It's weird to have this option in lines because mix with arcs. For Arcs and Curves the C key is very useful.

Some changes in bottom text too.
2018-12-15 12:19:43 +01:00
8695adddb4 GP: More control points more transparent
This helps to see the extremes of the stroke.
2018-12-15 12:02:40 +01:00
6d0cec5e0b Merge branch 'blender2.8' into greasepencil-object 2018-12-15 11:52:45 +01:00
1a44501f57 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/presets/keyconfig/keymap_data/blender_default.py
2018-12-14 19:17:08 +01:00
b0df9b51b4 Merge branch 'blender2.8' into greasepencil-object 2018-12-14 16:53:17 +01:00
eea081cd5f GP: Primitive: Revert adding new cursor and use nsew instead 2018-12-14 15:28:21 +00:00
ca17bf014b GP: Primitive, fix move bug 2018-12-14 15:05:09 +00:00
081a964db5 GP: Cleanup code and comments 2018-12-14 10:55:55 +01:00
92398166b0 Merge branch 'blender2.8' into greasepencil-object 2018-12-14 10:29:48 +01:00
1d4ea9d881 Fix smooth contour modifier for API changes 2018-12-14 14:57:51 +08:00
39f22cc857 Merge remote-tracking branch 'origin/blender2.8' into soc-2018-npr
# Conflicts:
#	source/blender/makesrna/intern/rna_scene.c
2018-12-14 14:47:39 +08:00
feb24c13b9 Fix accidental merge error 2018-12-14 14:46:43 +08:00
41b580619b GP: Primitive: Enable manipulators for Line/Box/Circle
Based on GP team feedback, all primitive tools have consistent behaviour.

Additionally:
AKEY extends Line, Arc and Curve.
CKEY changes type to Curve/Arc (toggle).
LKEY changes type to Line.
GKEY moves shape.
2018-12-14 01:25:18 +00:00
a6c0ec0cec Merge branch 'blender2.8' into greasepencil-object 2018-12-13 23:38:10 +01:00
f9bffb5b70 GP: Add Subdivide Smooth option 2018-12-13 23:30:29 +01:00
2719824a2e GP: Add missing Main Overlay switch to previous commit 2018-12-13 23:17:25 +01:00
6bc7180ca9 GP: Hide Primitive Gizmos with Overrlay switches
If disable Gizmo or Tool Gizmo the manipulators are not displayed.
2018-12-13 23:07:22 +01:00
84b7624b80 GP: Primitive: Add support for brush jitter and random strength
Also fix extra point bug.
2018-12-13 18:57:27 +00:00
3ef40443d4 Merge branch 'blender2.8' into greasepencil-object 2018-12-13 19:50:32 +01:00
9f4e8108fd GP: Remove redundant text 2018-12-13 19:38:25 +01:00
b79feba4c1 GP: New Smooth Operator in Specials menu
This Smooth works as in Meshes when you are in Edit mode.
2018-12-13 18:34:34 +01:00
5fb4f472da GP: Cleanup inverse loops
Why use inverse loops when we can use normal loops.
2018-12-13 14:12:40 +01:00
6fbf02f2a7 GP: Check if z-depth has valid values
If the values are too high, disable because not surface to project.
2018-12-13 13:56:42 +01:00
8042e5405e GP: Fix bug when start new file and select Arc primitive 2018-12-13 13:20:38 +01:00
42fe035cd2 Merge branch 'Blender2.8' into greasepencil-object 2018-12-13 12:45:11 +01:00
fa9c7f41d7 GP: Primitives, fix add curve behaviour
Reported by @_pepeland_

Also, add TAB key to exit edit mode.
2018-12-13 11:34:31 +00:00
c191f8d35f Merge branch 'blender2.8' into greasepencil-object 2018-12-13 11:52:29 +01:00
671748d877 Merge branch 'blender2.8' into greasepencil-object 2018-12-13 10:53:17 +01:00
bc8384d8a3 GP: Fix missing control points after merge 2.8 2018-12-12 22:42:02 +01:00
c07ba23896 GP: Refactor reproject in primitives 2018-12-12 21:50:09 +01:00
76d5500298 Merge branch 'blender2.8' into greasepencil-object 2018-12-12 19:49:52 +01:00
0ac991611a GP: Primitive: Change defaults
Based on User feedback from @mmendio.

The Arc tool now starts as a perfect arc in all directions.
The two control points for the Curve tool can be constrained to a single point using Shift.
Add Thickness profile to Box and Circle tools.
2018-12-12 17:56:33 +00:00
0cb674cd87 GP: Primitive: Avoid duplicate point when adding new curves 2018-12-12 15:11:01 +00:00
4ce6dfcd85 GP: Primitive: Arc tool changes
Added back constraint option to draw perfect arcs
Added back flip option
2018-12-12 14:13:03 +00:00
0fe997ae05 Merge branch 'blender2.8' into greasepencil-object 2018-12-12 14:44:21 +01:00
f1222d6115 Resume default contour detection method. 2018-12-12 21:22:51 +08:00
a33a3dfd74 Merge remote-tracking branch 'origin/blender2.8' into soc-2018-npr
# Conflicts:
#	source/blender/makesdna/DNA_scene_types.h
2018-12-12 19:02:58 +08:00
18301bf2cc GP: Print number of edges for Curves
This information was missing in bottom text  but you could change it.
2018-12-12 10:30:57 +01:00
46cdecbd0f GP: Reduce default edges for Box and Lines
Also avoid saving of edge number to reset for each new shape.
2018-12-12 10:26:59 +01:00
42767c180c Merge branch 'blender2.8' into greasepencil-object 2018-12-12 08:44:10 +01:00
63360df98f GP: Primitives: Adjust control point styles 2018-12-12 01:19:01 +00:00
1569196cf2 GP: Change Circle primitive control points
Changed to small red style.
2018-12-12 01:08:19 +00:00
351cd57aa0 GP: Editable Arc tool
Arc tool is now editable like the Curve tool.
Unlike the curve (bezier) tool this uses an elliptical function.
Remove flip option as it is no longer needed.
2018-12-12 00:54:08 +00:00
03d84f2b22 Merge branch 'blender2.8' into greasepencil-object 2018-12-11 18:47:55 +01:00
5734e0c2f8 GP: Fix box and circle cyclic on preview stroke 2018-12-11 17:43:25 +00:00
8e2f213746 GP: Remove "Close" from Bottom text
This was missing in previous commit.
2018-12-11 18:42:14 +01:00
0c4be6546c Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_primitive.c
2018-12-11 18:08:06 +01:00
fcb0e8c75f GP: Cleanup. Rename Beziers to Curve
Beziers name can be misunderstood for users. Curve is more generic.
2018-12-11 18:05:29 +01:00
7567700b15 GP: Remove cyclic option
Not compatible with new brush drawing.
2018-12-11 16:48:45 +00:00
2475d76dd9 GP: Remove Radius control point in Circles
This only adds complexity and don't communicate the information of the radius in a easy way, so it's better keep UI as clean as possible.
2018-12-11 17:40:49 +01:00
4886ab72ef GP: Test moving origin point to start control point for Arcs and Curves 2018-12-11 17:37:28 +01:00
0ed319cb0c GP: Add number of divisions in bottom message for Boxes
It was impossible to see the number of divisions used.
2018-12-11 17:29:24 +01:00
5e8cd30db1 GP: Restore origin point for Lines
Maybe is good tohave where is the origin of the line
2018-12-11 17:21:01 +01:00
ca7fd606da GP: Merge errors 2018-12-11 15:47:32 +00:00
9615d6f44a GP: Primitive, add noise to box and circle 2018-12-11 15:43:54 +00:00
522fab74a4 GP: Change control points size and remove in line 2018-12-11 16:34:57 +01:00
7a5080de0b GP: Fix memory leak 2018-12-11 16:24:07 +01:00
4370bc0c6e GP: Change constants by define for Ctrl points size
This makes changes easier and can be replace by variables or parameters easily.
2018-12-11 16:18:53 +01:00
85e253a934 Merge branch 'blender2.8' into greasepencil-object 2018-12-11 15:51:26 +01:00
3e169f0220 GP: Fix wrong end cap when finish stroke 2018-12-11 15:37:55 +01:00
c438ca96ba GP: Fix control points size when change zoom
Also replaced the shader used.
2018-12-11 15:22:42 +01:00
13e7eaee22 GP: Primitive, add brush noise 2018-12-11 13:44:06 +00:00
1d3756d4f7 GP: Remove orange line in primitives
After adding the preview of real stroke, this does not make sense.
2018-12-11 13:15:01 +01:00
0a2d9c58ee GP: Undo change for Buffer z-depth
This breaks the previous fix of orange line, but it's needed for projected strokes.
2018-12-11 13:08:23 +01:00
608504351d GP: Move drawing of control points to Draw Manager 2018-12-11 13:02:55 +01:00
2b888f8d21 GP: Line primitive, add support for thickness profile
This means that by default lines are drawn with multiple points rather than two.
2018-12-11 11:01:59 +00:00
cc1af80116 GP: Move Control Points data to Runtime
As we maybe will use these control points in more operators is not logic keep  them in operator temp data. This makes also possible move drawing to Draw Manager.
2018-12-11 11:25:33 +01:00
90d1665738 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2018-12-11 10:32:10 +01:00
49bf43e63a GP: Fix orange lines in primitives
The orange lines must be on top of the stroke. Before, the current stroke was drawn in Front, but since we have speed painting functions, we can draw on back.
2018-12-11 10:18:37 +01:00
252460b50a GP: Change Thickness Profile panel 2018-12-10 22:21:59 +01:00
944f1d4ae8 Merge branch 'blender2.8' into greasepencil-object 2018-12-10 20:30:43 +01:00
63537e77c3 GP: Use a fixed UV data for buffer end cap 2018-12-10 20:09:39 +01:00
2e488107ad GP: Fix problems with stroke Caps
Now the start cap is done and during drawing the end cap is not set because needs to have a UV calculated and this is not done while drawing.
2018-12-10 20:04:17 +01:00
f9dbee0cac Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2018-12-10 19:16:07 +01:00
b17c8dfe28 GP: Tidy 2018-12-10 16:45:06 +00:00
6073037ad8 GP: Primitives: tidy up control point code
The display of control points is temporary as this is still wip.
2018-12-10 16:42:59 +00:00
ac7618d0dc GP: Primitives: tidy up control point code
The display of control points is temporary as this is still wip.
2018-12-10 16:23:19 +00:00
41e059d344 GP: Add missing depsgraph update 2018-12-10 17:15:47 +01:00
fdff9ce59e GP: Set Brush default material when add new GP Object
Before the brush color was not set equal to object active color.
2018-12-10 16:54:49 +01:00
811cf683f1 GP: Remove Object Onion Skin switch
It was confusing to have two switches.
2018-12-10 16:42:40 +01:00
0c0f355ae3 GP: Replace Clamp icon 2018-12-10 16:21:34 +01:00
64c64d21e5 GP: Use floats for primitive coords 2018-12-10 14:28:07 +00:00
208ff2eb86 GP: Make Onion Skin ON as default RNA value 2018-12-10 14:33:10 +01:00
cdd2bba0fc Merge branch 'blender2.8' into greasepencil-object 2018-12-10 10:45:46 +01:00
19b066c41b GP: Enable Object Onion Skin by default
Now, the main switchis on, and the layer onion skin is off.
2018-12-10 10:43:29 +01:00
a6eb1bbf57 GP: Add offset over surface 2018-12-09 09:41:23 +01:00
6acfdbb6e1 GP: Add missing initialization for surface projection 2018-12-09 09:36:54 +01:00
8582a432a5 GP: Add support for drawing control points [wip]
Also renamed variables top, bottom -> start, end
2018-12-09 00:59:17 +00:00
e08c70d11c GP: Experimental test for Stroke project 2018-12-08 23:35:44 +01:00
e1d0312d8c GP: Cleanup typo 2018-12-08 23:35:02 +01:00
a3e3e2f2f1 Merge branch 'blender2.8' into greasepencil-object 2018-12-08 17:19:22 +01:00
Nick Wu
54443b6d90 Fix merge errors. 2018-12-08 22:55:29 +08:00
71f8d998c4 GP: Allocate stroke memory only when required 2018-12-08 11:17:57 +00:00
d778b0cc00 Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object 2018-12-07 22:11:32 +00:00
9b429d721c GP: Changes to bezier curve tool
When extending line with AKEY, prevent editing of joining point.
Update curve on initial draw, fixes pressure curve issue.
Change RMB to save and quite when editing.
2018-12-07 22:10:59 +00:00
d77446a681 Merge branch 'blender2.8' into greasepencil-object 2018-12-07 23:09:41 +01:00
4b3a48901a GP: Reorder Sculpt brushes in Tool bar 2018-12-07 22:59:40 +01:00
0be4c38125 GP: Fix primitive memory leak 2018-12-07 20:05:32 +01:00
205bfe524d Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/depsgraph/intern/depsgraph_tag.cc
	source/blender/editors/gpencil/gpencil_primitive.c
	source/blender/makesdna/DNA_ID.h
	source/blender/modifiers/intern/MOD_meshdeform.c
	source/blender/modifiers/intern/MOD_surfacedeform.c
2018-12-07 19:24:31 +01:00
4685cb6885 GP: Fix merge errors 2018-12-07 16:12:46 +00:00
7690ab09ad add 'Control Points' and 'Segments' editmode menus for Surfaces
Fixes T58922

Reviewers: brecht, billreynish

Maniphest Tasks: T58922

Differential Revision: https://developer.blender.org/D4046
2018-12-07 16:00:41 +00:00
Dalai Felinto
a01ccd09a8 Update BVHTree.FromObject API, remove render argument
This information should come from the depsgraph.
2018-12-07 16:00:41 +00:00
e03fd3c446 Cycles: Do more user-friendly indication that GPU devices are not found 2018-12-07 16:00:41 +00:00
fbeae89071 Cycles: Disable OpenCL on macOS
This is unfortunate, but the number of bugs in this configuration
keeps growing, and almost all of them are caused by bug in OpenCL
compiler.

The compiler is not likely to be fixed, since Apple declared OpenCL
deprecated.

This evil commit is aimed to keep officially supported features
of Blender in a good working and stable state.
2018-12-07 16:00:41 +00:00
a17abec24b Fix T58902: error getting tools for Image Editor (modes Paint and Mask)
Maniphest Tasks: T58902

Differential Revision: https://developer.blender.org/D4044
2018-12-07 16:00:41 +00:00
9c509d6b51 Fix T57640: UV unwrap packing not working without sync selection. 2018-12-07 16:00:40 +00:00
Dalai Felinto
4c41f8e9ad Partial fix to T58917 - No valid cage
The fix itself simply is to store the cage object as a pointer instead
of a string/name.

That said baking with or without cage is yielding very different results
than in 2.7.
2018-12-07 16:00:40 +00:00
1b1b28f4bd GP: Refactor coordinates to float
See: D4030

Differential Revision: https://developer.blender.org/D4036
2018-12-07 16:00:40 +00:00
e7b9d49e91 Fix/workaround crash opening almost any Spring file
The issue was caused mpoly array urequired by the cache filling,
but the pointer was never set when preparing render data.

Seems this change is safe enough, in terms it shouldn't be
causing slowdown, since the assignment of mpoly is cheap, but
hard to tell if there is anything else affected by thing underneath.
2018-12-07 15:59:47 +00:00
f6a0a8b89e Depsgraph: Make data allocation dependency more robust
This fix aims to fix crash/assert failure related on wrong
evaluation order which happens when there is a cyclic
dependency involved.

The rationality of this change is that we can allow use
of uninitialized scalar value, but memory is better be
allocated.

This might not be ideal still, but worth a try.
2018-12-07 15:59:47 +00:00
6646d1a8c6 Depsgraph: Use shorter relation name
It is clear enough already that it goes From to To.
2018-12-07 15:59:47 +00:00
5ee8111f15 Depsgraph: Cleanup, line length 2018-12-07 15:59:47 +00:00
c11cfa8072 Depsgraph: Remove duplicated sets of recalc/update flags
There were at least three copies of those:

- OB_RECALC* family of flags, which are rudiment of an old
  dependency graph system.
- PSYS_RECALC* which were used by old dependency graph system
  as a separate set since the graph itself did not handle
  particle systems.
- DEG_TAG_* which was used to tag IDs.

Now there is a single set, which defines what can be tagged
and queried for an update. It also has some aggregate flags
to make queries simpler.

Lets once and for all solve the madness of those flags, stick
to a single set, which will not overlap with anything or require
any extra conversion.

Technically, shouldn't be measurable user difference, but some
of the agregate flags for few dependency graph components did
change.

Fixes T58632: Particle don't update rotation settings
2018-12-07 15:59:47 +00:00
0e90627861 Cleanup/refactor binding code for MeshDeform modifier.
We had two different ways of doing it, SurfaceDeform and LaplacianDeform
would do it through a special modifier stack evaluation triggered from
binding operator, while MeshDeform would do it through a regular
depsgraph update/eval (also triggered from its binding op).

This enforces the later to search back for orig modifier data inside
modifier code (to apply binding on that one, and not on useless CoW
one).

Besides the question of safety about modifying orig data from threaded
despgraph (that was *probably* OK, but think it's bad idea in general),
it's much better to have a common way of doing that kind of things.

For now it remains rather dodgy, but at least it's reasonably consistent
and safe now.

This commit also fixes a potential memleak from binding process of
MeshDeform, and does some general cleanup a bit.
2018-12-07 15:57:47 +00:00
3323693ea0 Fix T58046: Crash when changing Particle type, when Hair has dynamics
thx @sergey for checking
2018-12-07 15:57:46 +00:00
4ff30177ad Cleanup: split mixed_bones_object_selectbuffer
Split basic object picking logic out into it's own function.
2018-12-07 15:57:46 +00:00
16ae5375fd Cleanup: style 2018-12-07 15:57:46 +00:00
a2201c870e Fix T58913 Won't focus on Grease Pencil
When the datablock was empty, the center was not calculated. Now it uses the object location.
2018-12-07 15:57:46 +00:00
df10669321 Fix T58911: Picking objects fails in pose mode 2018-12-07 15:57:46 +00:00
cc41bfb65c Fix T58811: Scale bezier handle uses tip as origin 2018-12-07 15:57:46 +00:00
9fc81d8cea Merge remote-tracking branch 'origin/blender2.8' into soc-2018-npr
# Conflicts:
#	release/scripts/addons_contrib
#	release/scripts/startup/bl_ui/properties_data_camera.py
#	release/scripts/startup/bl_ui/properties_material.py
#	release/scripts/startup/bl_ui/properties_particle.py
#	release/scripts/startup/bl_ui/properties_physics_common.py
#	release/scripts/startup/bl_ui/properties_physics_rigidbody.py
#	release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py
#	release/scripts/startup/bl_ui/properties_physics_softbody.py
#	release/scripts/startup/bl_ui/properties_scene.py
#	release/scripts/startup/bl_ui/properties_view_layer.py
#	release/scripts/startup/bl_ui/properties_world.py
#	source/blender/draw/intern/draw_manager.c
#	source/blender/makesrna/intern/rna_scene.c
2018-12-07 22:53:30 +08:00
0eabdabfae GP: Clear selected flag for new primitives 2018-12-07 15:46:40 +01:00
d22455089c GP: Fix wrong extreme in primitive 2018-12-07 15:23:09 +01:00
8cfc8e6347 GP: Fix multi-segment curve
Currently, only last segment is editable.
2018-12-07 14:17:17 +00:00
a62728abea GP: Remove curve for Lines
Lines only have 2 points, so it's not logic.
2018-12-07 13:27:55 +01:00
f23bd736de GP: Curve edit mode is now default after initial line
No need to hold shift.
2018-12-07 12:27:21 +00:00
70297337e0 GP: Enable curve only for Arcs and Beziers 2018-12-07 13:25:56 +01:00
45fe039c14 GP: Change default primitive curve 2018-12-07 13:17:32 +01:00
70a2eeba9e GP: Fix segment fault with primitive curve 2018-12-07 12:53:42 +01:00
fc97baf73a GP: Fix problems with primitive curve and add to Topbar 2018-12-07 12:49:12 +01:00
d690a1e32c GP: Evaluate curve for thickness in primitives 2018-12-07 11:34:36 +01:00
60d953ae30 GP: New curve to define thickness in primitives 2018-12-07 11:16:09 +01:00
5a4166b9b8 Merge branch 'blender2.8' into greasepencil-object 2018-12-07 08:22:21 +01:00
8aa0188de5 GP: Use brush strength when draw primitves 2018-12-06 19:21:45 +01:00
fec794bd3e GP: Bezier tidy
Remove unused defines and prevent num input while editing
2018-12-06 18:18:32 +00:00
454563ffac GP: Add bezier tool [wip]
Shift drag to move curve.
Ctrl-shift to move both cps.
2018-12-06 17:10:54 +00:00
0013bfdf25 GP: Fix gap drawing Circle, Rectangle and Arc primitives 2018-12-06 17:02:20 +01:00
2bcc5f8bde Draw real stroke while using a primitive 2018-12-06 13:13:47 +01:00
51e39ce568 Copy drawing data to stroke buffer
Still the draw manager is not calling to draw this datablock.
2018-12-06 12:32:14 +01:00
5d7474ae01 Prepare buffer stroke to save points 2018-12-06 12:18:11 +01:00
5bed2a23c5 Fix merge errors 2018-12-06 11:57:18 +01:00
2e0ef10670 Merge branch 'blender2.8' into greasepencil-object 2018-12-06 10:49:48 +01:00
231355fd09 Merge branch 'blender2.8' into greasepencil-object 2018-11-28 19:23:17 +01:00
f2fdfbb735 Change default annotation onion colors 2018-11-28 18:08:18 +01:00
8a0ed1214e Cleanup: Fix comment typo 2018-11-28 17:21:57 +01:00
5dadb95909 Enable Onion Skin for Annotations
Back port and adapt to 2.8 the onion skin for annotations in View 3D and Sequencer.

Added only basic features. For onion skin advanced features use grease pencil object.
2018-11-28 17:19:41 +01:00
f2161312f2 Merge branch 'blender2.8' into greasepencil-object 2018-11-28 16:54:32 +01:00
2614f21412 Add vtx boundry setting 2018-11-27 17:25:15 +01:00
63c0427b55 Merge branch 'blender2.8' of https://git.blender.org/blender into npr_tess 2018-11-27 16:22:03 +01:00
54cf0461fc Merge branch 'blender2.8' into greasepencil-object 2018-11-26 17:47:37 +01:00
4b8d091c90 Reorganize Mask button and rename to Clamp
Now the Clamp is valid in Normal layers and the value is OFF by default.
2018-11-26 17:34:40 +01:00
a14da4a859 Use Stroke Alpha when mix Normal Layers 2018-11-26 16:17:58 +01:00
Nick Wu
a1a526e557 added example functions for accessing LANPR occlusion data 2018-11-26 21:47:11 +08:00
Nick Wu
e4d987d7fb Added temporary contour bypass for smooth contour modifier build. 2018-11-26 20:27:36 +08:00
Nick Wu
c94b494f20 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	release/scripts/addons
#	release/scripts/addons_contrib
#	source/blender/makesdna/DNA_scene_types.h
#	source/blender/makesrna/intern/rna_scene.c
#	source/tools
2018-11-26 20:15:13 +08:00
0669f08437 Rename Bled Layers to Layers Blending 2018-11-26 11:15:37 +01:00
ec07eeba1c Merge branch 'blender2.8' into greasepencil-object 2018-11-26 08:54:11 +01:00
1f9119a059 Fix multiply error when blend layer do not cover below layer 2018-11-25 20:12:04 +01:00
2104b22dad Merge branch 'blender2.8' into greasepencil-object 2018-11-25 19:35:53 +01:00
018d7039c4 Fix opacity problems when value is 0 2018-11-25 19:28:17 +01:00
6ce9e29296 Fix noise in blend layers
The antialiasing is generating noise in intermediate layers.
2018-11-25 19:04:24 +01:00
03d125b881 Fix problems with Mask button 2018-11-25 18:14:51 +01:00
f63633cc9d Fix ALT key for boundary fill strokes 2018-11-25 17:39:14 +01:00
dac044d03c Add Simplify Blend Layers option 2018-11-25 17:23:03 +01:00
5b7780920b Merge branch 'blender2.8' into greasepencil-object 2018-11-25 16:27:39 +01:00
fdb51ac280 Enable layer opacity in blend layers 2018-11-25 16:26:01 +01:00
3884d76645 Adjust Blend mode y Opacity to column 2018-11-25 16:12:14 +01:00
72cc5c291f Use multisample for nomal blend
The layers are multisampled before blend
2018-11-25 16:02:40 +01:00
c5acc7ae36 Hide Mask Icon in Layer list
By default is off and it's something that is using too much space
2018-11-25 14:17:04 +01:00
01d27d0b2b Use Box blur for Edges 2018-11-25 14:13:41 +01:00
6f66bcff3f Change tooltip 2018-11-25 14:13:31 +01:00
78c8a26322 Invert Mask flag to be ON by default 2018-11-25 09:44:25 +01:00
07d68ff0dc Fix problem when several objects 2018-11-24 13:39:55 +01:00
0d1e36cd18 Only show Mask icon for Blend layers 2018-11-24 13:15:45 +01:00
c4f5477dec Fix error when blend layers are consecutive 2018-11-24 12:44:40 +01:00
01a1b977dc GP: Reorganize Mask icons 2018-11-24 12:25:40 +01:00
3aa787a23a GP: New option to enable masking
Now the blend masking can be enabled or disabled
2018-11-24 12:02:37 +01:00
43237796a6 Merge branch 'blender2.8' into greasepencil-object 2018-11-24 10:12:38 +01:00
f2806a3b04 GP: Apply alpha to mix color 2018-11-23 20:18:04 +01:00
06c7d3ab28 Merge branch 'blender2.8' into greasepencil-object 2018-11-23 19:45:43 +01:00
1991bd5c65 GP: Exchange opacity and blend parameters in Panel 2018-11-23 19:22:49 +01:00
46567d982f GP: Disable opacity of Blend layers
The opacity parameter is not logic for blend layers because the opacity is determined by underlying layers.
2018-11-23 19:20:38 +01:00
fac51e039d Avoid error adding layer 2018-11-23 17:47:56 +01:00
d121071a0f GP: Cleanup unused variable 2018-11-23 17:01:38 +01:00
a8bcfe4c31 WIP: Support Blend layer
This new option for Layers allow to define the blend mode between layers to create effects and help with the painting of the frames.

Note: If use substract to open holes, you can get the transparent problem we already know and that it's pending to solve using OIT.
2018-11-23 16:53:41 +01:00
5ec6e95a75 Merge branch 'blender2.8' into greasepencil-object 2018-11-23 16:24:41 +01:00
e7d2f0e880 Add GP modifer to extract strokes 2018-11-23 00:16:07 +01:00
60d541c728 Add option to select contour verts 2018-11-22 23:05:26 +01:00
1c1ec90486 Merge branch 'blender2.8' into greasepencil-object 2018-11-20 20:17:01 +01:00
e39461d83b Merge branch 'blender2.8' into greasepencil-object 2018-11-20 19:12:53 +01:00
6083edbeea Merge branch 'blender2.8' into greasepencil-object 2018-11-20 16:35:13 +01:00
f32368591c Merge branch 'blender2.8' into greasepencil-object 2018-11-20 09:28:01 +01:00
ac197f50d5 Fix problem with onion in multiwindow mode 2018-11-19 20:09:18 +01:00
3798303749 Fix problem with storage index
The storage index was not updated and the object scale and other data were wrong
2018-11-19 19:47:27 +01:00
f1255ba320 Use Time Offset modifier to calc VBOs size
The active frame can be different if there is a time offset modifier.
2018-11-19 17:15:47 +01:00
ee58b97b44 GP: Small cleanup 2018-11-19 16:55:22 +01:00
9e38c89684 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
2018-11-19 16:30:04 +01:00
bdbbadab75 GP: Recalc VBOs size with modifiers
Some modifiers can change the total number of points.
2018-11-19 16:26:34 +01:00
461387051d GP: Alloc maximum size
The resize of the VBOs is very heavy for the CPU, so now the maximum size is allocated.
2018-11-19 11:37:30 +01:00
Nick Wu
3c7da86849 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	release/scripts/addons
#	release/scripts/addons_contrib
#	source/blender/makesdna/DNA_lamp_types.h
2018-11-19 12:51:52 +08:00
cb0934477e Change default VBO size for FILL 2018-11-18 20:36:34 +01:00
6357ac5409 Merge branch 'blender2.8' into greasepencil-object 2018-11-18 19:49:00 +01:00
371f53bd73 GP: Some fixes after merge 2018-11-18 17:06:41 +01:00
ca89a6b3a0 Merge branch 'blender2.8' into greasepencil-object 2018-11-18 16:39:31 +01:00
680f8039eb GP: Drawing Engine use only one batch
This is part of T57829.

Reduce the number of used batches to only one by shader type.  This reduces GPU overhead and increase a lot the FPS. As the number of batches is small, the time to allocate and free memory was reduced in 90% or more.

Also the code has been simplified and all batch management has been removed because this is not necessary. Now, all shading groups are created after all vertex buffer data for all strokes has been created using DRW_shgroup_call_range_add().

All batch cache data has been moved to the Object runtime struct and not as before where some parts (derived data) were saved inside GPD datablock.

For particles, now the code is faster and cleaner and gets better FPS.

Thanks to Clément Foucault for his help and advices to improve speed.
2018-11-17 17:52:19 +01:00
aef6f7d75e Merge branch 'blender2.8' into greasepencil-object 2018-11-17 09:58:15 +01:00
Nick Wu
13a654d0f3 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-11-14 11:34:27 +08:00
Nick Wu
821aa86d98 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	release/scripts/startup/bl_ui/properties_scene.py
2018-11-14 11:32:17 +08:00
3f1f1931e7 Update to new API changes 2018-11-12 14:57:52 +01:00
a2b31ed120 Merge branch 'blender2.8' into npr_tess 2018-11-12 13:20:58 +01:00
0277819b18 Fixed corner case with mult_face_search and shifted border verts 2018-11-09 19:17:08 +01:00
896dbf836b Fix strack smash for deg edges, move opti flip to own function 2018-11-08 00:45:59 +01:00
Nick Wu
fc650ae86a Make ui work under new api. 2018-11-07 22:37:14 +08:00
Nick Wu
b77c6a859e Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	release/scripts/addons
#	release/scripts/addons_contrib
#	source/blender/makesdna/DNA_scene_types.h
#	source/tools
2018-10-31 13:45:08 +08:00
4a90ddad76 Fix mixed indent 2018-10-29 20:25:29 +01:00
d18fa37cad Fix FB split face logic 2018-10-29 20:02:06 +01:00
Nick Wu
fc94e46f36 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-10-25 17:54:30 +08:00
Nick Wu
7a34d16d7a Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-10-21 14:16:32 +08:00
1c14aee5b1 Merge branch 'blender2.8' into greasepencil-object 2018-10-20 09:18:02 +02:00
Nick Wu
6a638e9555 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr, also fix errors in modifier code.
# Conflicts:
#	release/scripts/startup/bl_ui/properties_data_camera.py
#	release/scripts/startup/bl_ui/properties_data_speaker.py
#	release/scripts/startup/bl_ui/properties_render.py
#	release/scripts/startup/bl_ui/properties_scene.py
#	source/blender/makesrna/intern/rna_scene.c
2018-10-20 13:05:21 +08:00
270cd09afa Merge branch 'blender2.8' into greasepencil-object 2018-10-19 15:03:02 +02:00
8eff6c4223 GP: Fix problem with Onion Skin after last commit 2018-10-19 12:13:38 +02:00
c2aefb8ea4 GP: Redesign drawing cache to support particles
Full redesign of the cache system used for drawing strokes and handle derived frame data.

Before, the cache was saved in bGPdata and a hash was used to manage several objects with the same datablock.

Old design made the use of particles very inefficient and prone to bugs and segment faults, and especially when this was mixed with onion skinning and multiple objects using same datablock. Also, there were some conflicts with the depsgrah logic (the old design was done before despgraph was in place) that made the use of hash not working.

The new design saves the data in the object runtime struct and avoid the use of any hash to find the right data. This improves the speed and reduce a lot the complexity of the code, memory allocation, hash overload and adds full support for particles and reused datablocks.

The particles can reuse the modifiers and shader effects of the original grease pencil object.
2018-10-19 11:35:58 +02:00
e96f7ab0ed Merge branch 'blender2.8' into greasepencil-object 2018-10-19 11:11:31 +02:00
12d345af03 Made opti edge flip use actual face normals and fiddled a bit with cusps again 2018-10-16 17:04:38 +02:00
f8d633f3e7 Fix FB split uv bug and treat cusps more like in the paper 2018-10-08 19:50:43 +02:00
Nick Wu
0bc6e431cc Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	source/blender/makesrna/intern/rna_scene.c
2018-10-03 18:30:02 +08:00
Nick Wu
8ae40f4fcb Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	release/scripts/addons
2018-09-19 22:24:36 +08:00
Nick Wu
74294b8686 Fix interface lock situation reported by DarkDefender. 2018-09-17 21:49:08 +08:00
Nick Wu
923f59a984 DPIX normal controlled line width 2018-09-16 15:35:41 +08:00
Nick Wu
843a57e3a5 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	release/scripts/addons
2018-09-16 15:02:02 +08:00
Nick Wu
bef1fb79ee Vertical line hack: tip point threshod fix and a condition branch. 2018-09-16 15:00:57 +08:00
3a9e7bf92d Merge branch 'blender2.8' into greasepencil-object 2018-09-15 12:09:20 +02:00
Nick Wu
1bd6f3605d Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	release/scripts/addons_contrib
#	release/scripts/startup/bl_ui/properties_physics_cloth.py
#	source/tools
2018-09-15 11:03:29 +08:00
Nick Wu
85f6277e6c Possibly fixed shader errors, but don't know exactly what caused it. 2018-09-12 23:03:34 +08:00
Nick Wu
b3ed2a8751 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	source/tools
2018-09-12 22:27:01 +08:00
29cb9e057d Increased the amount of faces the inco check will search 2018-09-10 12:19:21 +02:00
c9961e4d0b Fix memleak when creating eval 2018-09-08 23:00:41 +02:00
d574014a91 Remove opti vert dissolve 2018-09-08 15:42:28 +02:00
cf3f8c46fd Merge branch 'blender2.8' into greasepencil-object 2018-09-08 11:14:47 +02:00
Nick Wu
4498126016 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	source/blender/draw/CMakeLists.txt
#	source/blender/makesrna/intern/rna_scene.c
2018-09-07 23:13:23 +08:00
Nick Wu
c44e716f9c Fixed still frame render cache out of date error. 2018-09-07 22:16:21 +08:00
9a51f1567b Merge branch 'blender2.8' into greasepencil-object 2018-09-07 09:21:29 +02:00
Nick Wu
dacceb573f Fixed vertical line missed calculations. 2018-09-06 13:39:55 +08:00
Nick Wu
fceb384ad1 Partly fixed "Absolute horizontal/vertical" situations. 2018-09-06 12:01:26 +08:00
Nick Wu
b6b0d986bb Fixed contour priority. Fixed software mode line type shader. 2018-09-06 10:49:22 +08:00
Nick Wu
3ab0ae97cd Merge branch 'soc-2018-npr' of git.blender.org:blender into soc-2018-npr 2018-09-06 09:54:20 +08:00
Nick Wu
7f4daea0c0 Fixed line width incorrect variations under different aspect ratios. commented weird code in culling. 2018-09-06 09:53:10 +08:00
Nick Wu
cdad75303a Fixed line width incorrect variations under different aspect ratios. 2018-09-06 09:48:04 +08:00
Nick Wu
eeeee3b10a Fixed software mode ortho condition errors in culling. Now working. 2018-09-06 09:25:22 +08:00
Nick Wu
592b2bd5e4 Fixed DPIX ortho view. 2018-09-06 09:01:50 +08:00
Nick Wu
4df5506b22 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	source/blender/makesdna/DNA_scene_types.h
2018-09-06 08:30:31 +08:00
57cf101dbd Merge branch 'blender2.8' into greasepencil-object 2018-09-04 17:35:12 +02:00
Nick Wu
de2c47cbf1 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	source/blender/makesdna/DNA_scene_types.h
2018-09-04 21:52:48 +08:00
Nick Wu
f0eca87df6 Fixed collection header name 2018-09-04 12:56:46 +08:00
b216e9e81b Merge branch 'blender2.8' into greasepencil-object 2018-09-03 08:29:24 +02:00
Nick Wu
3fc578d7cb Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	source/blender/CMakeLists.txt
2018-09-01 11:03:10 +08:00
Nick Wu
ef234a2e61 Software crease threshold follow DPIX's 2018-08-31 21:48:19 +08:00
ed9a4cb95f Merge branch 'blender2.8' into greasepencil-object 2018-08-31 10:11:54 +02:00
290d366b61 Merge branch 'blender2.8' into greasepencil-object 2018-08-30 15:57:34 +02:00
5d168135e8 Merge branch 'blender2.8' into greasepencil-object 2018-08-30 12:26:25 +02:00
ed47fc02e1 Merge branch 'blender2.8' into greasepencil-object 2018-08-30 11:22:23 +02:00
01823ea736 Merge branch 'blender2.8' into greasepencil-object 2018-08-30 10:21:15 +02:00
f558b43373 Merge branch 'blender2.8' into greasepencil-object 2018-08-29 20:29:21 +02:00
Nick Wu
552d256cfd Merge branch 'npr_tess' of https://github.com/DarkDefender/blender into soc-2018-npr 2018-08-29 19:08:14 +08:00
4ab09aad67 Update tess mod UI split code to upstream changes 2018-08-29 13:07:31 +02:00
f4b65dd63c Merge branch 'blender2.8' into npr_tess 2018-08-29 12:58:16 +02:00
Nick Wu
e9d3c2e8fb Merge branch 'npr_tess' of https://github.com/DarkDefender/blender into soc-2018-npr 2018-08-29 18:42:08 +08:00
7ef8404f4e Always use get_facing function when possible 2018-08-29 12:29:09 +02:00
b1d1ea8f8b Only check for FF/BB split on edges that are somewhat close to a zero crossing 2018-08-29 12:06:25 +02:00
7b32c913c1 Change how opti marks inco faces initially 2018-08-29 11:02:16 +02:00
2f1f4b5115 Cleanup code 2018-08-29 10:54:15 +02:00
dce768b263 Rename all armature modifiers
Now it's possible add several armature modifiers, so need rename all of them, not only first one.
2018-08-29 10:39:48 +02:00
6bf998a893 Merge branch 'blender2.8' into greasepencil-object 2018-08-29 10:18:47 +02:00
eb5efaa558 Merge branch 'blender2.8' into greasepencil-object 2018-08-28 21:57:16 +02:00
c16126246b Fix some errors in Simplify and Subdivide 2018-08-28 21:51:46 +02:00
2098adf2ea Fix several things 2018-08-28 17:03:47 +02:00
f8bd98194f Merge branch 'blender2.8' into greasepencil-object 2018-08-28 16:29:13 +02:00
7790545475 Cleanup: fix merge small mistake 2018-08-28 13:29:55 +02:00
792f92e983 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_paint.c
2018-08-28 13:18:34 +02:00
Nick Wu
1e70595e05 Fixed file data blocks linking error. 2018-08-28 18:52:40 +08:00
73de6c2725 Use default armature of Modifier
By default try to use the armature of first modifier, but allows to select different armatures.

This is required for special configurations with several armature modifiers.
2018-08-28 12:35:26 +02:00
Nick Wu
bcc3003cb4 Fixed chained line type display control 2018-08-28 18:23:58 +08:00
c3f2a5e0fc New parameter to select armature in Automatic Weights op.
Before, the operator always used the armature of the modifier, but now it's possible to have several modifiers, so it needs a parameter to select the armature.
2018-08-28 12:15:36 +02:00
Nick Wu
775df5a1d5 Fix directional object matrix error 2018-08-28 18:10:18 +08:00
Nick Wu
8072b68387 Directional light control object ok, fixing file rw 2018-08-28 17:34:12 +08:00
Nick Wu
f33c3d157c Fixed dropdown list reference lost issue. 2018-08-28 16:07:17 +08:00
Nick Wu
6b005517db Normal controlled normal thickness for software is ok. No direction and position variation. 2018-08-28 15:48:36 +08:00
613c920275 Merge branch 'blender2.8' into greasepencil-object 2018-08-28 09:31:03 +02:00
Nick Wu
0b758fd994 Software normal control thickness for non-chain situation 2018-08-28 14:13:57 +08:00
Nick Wu
db66c3a9a2 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	release/scripts/addons
#	release/scripts/addons_contrib
#	source/tools
2018-08-28 12:46:50 +08:00
c5924b3a64 Merge branch 'blender2.8' into greasepencil-object 2018-08-27 22:32:30 +02:00
6f4d709ad2 Fix vertex group functions after merge
The custom api has been replaced by standard functions.
2018-08-27 16:51:37 +02:00
9cdbe5b129 Merge branch 'blender2.8' into greasepencil-object 2018-08-27 16:32:54 +02:00
ccda31aa48 Redo Armature modifier using standard modules
Now the armature modifier is using the same functions used in Mesh and Lattice armatures and share the same parameters.

This makes the code easy to maintain.
2018-08-26 19:39:56 +02:00
714a133083 Merge branch 'blender2.8' into greasepencil-object 2018-08-26 17:27:13 +02:00
45edce5fa9 More fixes after merge 2018-08-26 17:12:32 +02:00
f94384afc6 Changes after merge and some cleanup
Added some initialization code and fixed some isues after merge.
2018-08-26 17:06:43 +02:00
e52b914782 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/gpencil_modifier.c
	source/blender/editors/gpencil/gpencil_edit.c
	source/blender/editors/gpencil/gpencil_fill.c
	source/blender/editors/gpencil/gpencil_paint.c
2018-08-26 16:49:26 +02:00
Nick Wu
fba6d68915 Merge branch 'npr_tess' of https://github.com/DarkDefender/blender into soc-2018-npr 2018-08-26 20:13:30 +08:00
Nick Wu
5d21c3089d Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-08-26 10:28:55 +08:00
8ecb34982e Allow wiggling of radial verts 2018-08-25 21:04:21 +02:00
80b44aaa26 Change name of 'is_C_vert' func to something more descriptive 2018-08-24 21:05:29 +02:00
925333e51d Merge branch 'blender2.8' into greasepencil-object 2018-08-24 10:18:44 +02:00
f79e734ff3 Merge branch 'blender2.8' into greasepencil-object 2018-08-23 16:15:23 +02:00
Nick Wu
8e58b88ea4 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	release/scripts/addons
#	release/scripts/addons_contrib
#	source/tools
2018-08-23 18:55:32 +08:00
Nick Wu
4b763f4cb2 Fixing perpective flag 2018-08-23 18:53:37 +08:00
b4f9b25107 Merge branch 'blender2.8' into greasepencil-object 2018-08-23 10:18:19 +02:00
462c69d288 Rename function and fix wrong pointer increment
The change done in previous cleanup broken the function.
2018-08-23 10:15:19 +02:00
5262e21c6c Cleanup style 2018-08-23 10:15:13 +02:00
7fc1d6cf96 Cleanup: Unused variable 2018-08-23 10:15:08 +02:00
39344493e3 Add Force Fill Data parameter
Add a general parameter to force the recalc of the triangulation data because some modifiers could change the geometry and the filling triangles would not be right.

Now, the parameter is visible in UI panel because this option reduces FPS, but maybe in the future we can keep always ON and remove the parameter.
2018-08-23 10:15:02 +02:00
ee212fd204 UI: Change text of force recalc 2018-08-23 10:14:56 +02:00
b91deea4dc Change calculation of automatic weights
There were several mistakes and now is using standard routines.
2018-08-23 10:14:48 +02:00
62f67b8bef Implement Parent with Empty and Automatic weights
This is an alternative way of define weights.
2018-08-23 10:14:43 +02:00
f92e13a4eb Enable Fade geometry in Pose mode
Now the grease pencil geometry is fade when the alpha value is enabled.
2018-08-23 10:14:38 +02:00
948e1de325 Rename parent layer when change bone name 2018-08-23 10:14:32 +02:00
7088c211a5 Rename bone if Armature modifier 2018-08-23 10:14:27 +02:00
b425c0a302 Add weight data when drawing 2018-08-23 10:14:21 +02:00
cdad9b4960 Keep weight when simplify with RDP 2018-08-23 10:14:15 +02:00
fbc2a8a604 Interpolate weights when subdivide 2018-08-23 10:14:10 +02:00
ec58cb0429 Manage weights in simplify operator and modifier 2018-08-23 10:14:04 +02:00
c91aaf5891 More changes to subdivide modifier 2018-08-23 10:13:58 +02:00
8ddbcd67f4 Add weights to subdivide points 2018-08-23 10:13:51 +02:00
9d3cea5e54 Improvements in automatic weight calculation 2018-08-20 11:22:25 +02:00
ad5dc176a7 New parameter to force Fill cache recalc
This is needed for extreme deformations
2018-08-19 20:50:32 +02:00
dfdf4514a5 New operator to generate automatic weights 2018-08-19 17:22:35 +02:00
643afc347b WIP: Operator to create vertex groups
Only works with the Empty mode.
2018-08-19 13:04:21 +02:00
89e8ccaacf Cleanup unused function 2018-08-19 11:41:14 +02:00
d634916624 Cleanup code and comments 2018-08-18 22:47:27 +02:00
b5301a185c Limit Armature modifier to only one instance 2018-08-18 22:32:00 +02:00
e9e1e8f6dc More cleanup 2018-08-18 20:17:26 +02:00
9d937032b9 Code cleanup: remove unused code 2018-08-18 19:22:17 +02:00
e4082db577 Put text to review 2018-08-18 18:43:03 +02:00
c3ba8910a1 WIP: Add basic functions to deform 2018-08-18 18:08:22 +02:00
31a1135829 Merge branch 'blender2.8' into greasepencil-experimental 2018-08-18 17:37:26 +02:00
96d9b20aa2 Put in place all pieces for Armature modifier
The modifier doesn't do anything yet.
2018-08-18 17:36:54 +02:00
Nick Wu
4594287191 Fixed some matrix fuction naming format 2018-08-18 17:51:13 +08:00
Nick Wu
4af59419fc Software mode FOV adapted. 2018-08-18 17:39:09 +08:00
Nick Wu
1f5b23318b Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	release/scripts/addons_contrib
#	release/scripts/startup/bl_ui/properties_physics_field.py
#	source/blender/makesdna/DNA_scene_types.h
#	source/tools
2018-08-18 14:04:38 +08:00
Dalai Felinto
57b5a4e805 Merge remote-tracking branch 'origin/blender2.8' into greasepencil-object
Hard-core resetting the files to origin/blender2.8
2018-08-17 12:54:18 -03:00
Nick Wu
d40a1bc3cc Merge branch 'npr_tess' of https://github.com/DarkDefender/blender into soc-2018-npr
# Conflicts:
#	release/scripts/addons
#	release/scripts/addons_contrib
#	source/blender/editors/space_outliner/outliner_draw.c
#	source/blender/makesdna/DNA_scene_types.h
#	source/blender/modifiers/intern/MOD_mybmesh.c
#	source/tools
2018-08-16 15:37:02 +08:00
51ead449f7 Add sanity check in mult_face_search 2018-08-15 19:03:28 +02:00
ae4185f96f Merge with upstream changes 2018-08-15 18:09:17 +02:00
4c77b378a5 More opti step tweaks 2018-08-15 17:17:11 +02:00
c9831644e6 Make shift fold check and radial insert check more robust 2018-08-14 21:16:21 +02:00
e49f7e6b64 Add sanity check for radial insert face selection 2018-08-14 19:40:44 +02:00
d8a9fd7810 Do not shift cusp edges as they might lead to CCC triangles 2018-08-14 19:23:03 +02:00
3607e52a6b Remove fold check from opti wigg/split and fix new vert idx bug 2018-08-14 17:48:10 +02:00
Nick Wu
7aa1c544f7 Fix opensubdiv error when not enabled WITH_OPENSUBDIV 2018-08-14 16:20:19 +08:00
Nick Wu
dc03876c7b Fixed engine compatible panel for camera and speaker data. 2018-08-14 13:44:04 +08:00
Nick Wu
0b75e68500 Fixed lanpr field always NULL error. (caused by depsgraph scene copy) 2018-08-14 13:39:44 +08:00
dee286cdb9 Update new vert data if they are shifted 2018-08-13 17:30:07 +02:00
5ef6bcd645 Convert to opti wigg and edge slit to use st coords 2018-08-13 16:11:21 +02:00
b0489b96f7 Convert mult_face_search to use st space for better accuracy 2018-08-13 15:31:04 +02:00
7b1875b442 Make radial insert and exten work in 2d space (better accuracy) 2018-08-13 14:27:27 +02:00
1ef4dc3265 Fix broken normal calculation of flipped faces 2018-08-12 15:34:05 +02:00
23501383bb Add new heuristic in opti step 2018-08-11 18:58:28 +02:00
1a59bc7ecf Modify opti edge split and vertex wigg so they can move new verts 2018-08-11 17:19:53 +02:00
Nick Wu
cefcf402cb Fixed taper on software side 2018-08-10 17:13:57 +08:00
Nick Wu
18cc07076d Fixed taper on software side, merged tess modifier's osd adapter. 2018-08-10 17:13:09 +08:00
6d9f748e5a Merge branch 'blender2.8' into npr_tess and update to new blender OSD API 2018-08-10 10:43:59 +02:00
Nick Wu
251dbabdf1 Fixed enum in modifier IDs (npr tess modifier and a merged new one) 2018-08-10 16:18:31 +08:00
Nick Wu
2d01210ea7 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	release/datafiles/locale
#	release/scripts/addons_contrib
#	source/blender/editors/mesh/editmesh_tools.c
#	source/blender/editors/space_outliner/outliner_draw.c
#	source/blender/makesdna/DNA_modifier_types.h
#	source/blender/makesrna/intern/rna_modifier.c
#	source/blender/modifiers/MOD_modifiertypes.h
#	source/blender/modifiers/intern/MOD_util.c
#	source/tools
2018-08-10 15:56:46 +08:00
Nick Wu
83c85c9c98 Fixed shader variable naming style issue. 2018-08-10 15:51:08 +08:00
Nick Wu
89e9c1405c Python panel engine adaptations 2018-08-10 15:36:02 +08:00
874b1a38af Tweak how potential folds are detected in opti wigg 2018-08-09 23:24:39 +02:00
2c61729764 More work on radi insertion 2018-08-09 22:38:21 +02:00
0b8e41098c Rewrite mult_radi 2018-08-09 20:51:46 +02:00
Nick Wu
4d7d0b60d1 Modified UI for background color display and line layer on DPIX. Added console warning for software rendering. 2018-08-09 15:41:30 +08:00
80ff0dd03c Change cusp edge shift criteria 2018-08-08 17:23:43 +02:00
7b038b6a06 Added check if radial insertion flip will create a fold 2018-08-08 16:10:25 +02:00
Nick Wu
ca07177f5b Merge branch 'npr_tess' of https://github.com/DarkDefender/blender into soc-2018-npr 2018-08-08 21:55:54 +08:00
bfae9afeb3 Fix faulty opti radi extend logic 2018-08-08 10:17:23 +02:00
0717bdea66 Fix some gcc warnings 2018-08-07 20:48:09 +02:00
189de98ac1 Added a very basic cache system 2018-08-07 19:30:07 +02:00
Nick Wu
d9b0c6711e Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-08-07 19:57:07 +08:00
cb1d57f0f7 Added a multithreaded variant of split ff bb 2018-08-06 23:57:43 +02:00
ba0a4372ca Comment spammy debug prints 2018-08-05 23:12:35 +02:00
33abe49d38 Fixed opti edge flip not nulling corrected face and add sanity opti checks 2018-08-05 22:20:09 +02:00
Nick Wu
80e3a97744 Adapted shader APIs to DRW_ 2018-08-04 09:53:03 +08:00
Nick Wu
356dc7892b Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-08-04 09:34:15 +08:00
71fbf963af Simplyified mutl_face_search (should now be more robust too) 2018-08-03 20:26:59 +02:00
3daac4d4cc More work on opti edge split 2018-08-02 18:53:12 +02:00
Nick Wu
44f0f14232 Fixed software triangle and render line culling bug. (crappy, but works correctly) 2018-08-01 23:21:20 +08:00
Nick Wu
d2f77ce653 Uncrustify processed. 2018-08-01 20:29:17 +08:00
Nick Wu
7866c2fb05 potentially fixed drawing command conflict error in F12 2018-08-01 18:50:08 +08:00
Nick Wu
64c2578228 Fixed software rendering intersection cache update 2018-08-01 16:19:34 +08:00
Nick Wu
9b06c78676 Adapted multisample functions. 2018-08-01 12:08:05 +08:00
Nick Wu
3b36c698cd Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	release/scripts/addons
#	release/scripts/addons_contrib
#	release/scripts/startup/bl_ui/properties_scene.py
#	source/blender/draw/CMakeLists.txt
#	source/blender/editors/space_outliner/outliner_draw.c
2018-08-01 10:15:47 +08:00
48c96f6f01 Merge branch 'blender2.8' into greasepencil-object 2018-07-31 09:54:05 +02:00
be27284b76 Only align to view by default Monkey GP object
The blank grease pencil object must be aligned to axis by default.
2018-07-31 08:57:55 +02:00
2e4527f3ca Add a warning in annotations if active object is GP
Now the annotations is not working with grease pencil object selected and we need inform the user.

We need find a better solution for this, but at least we have a notification and not something that looks a bug, but a not supported function.
2018-07-30 22:21:13 +02:00
64fff35c2e Merge branch 'blender2.8' into greasepencil-object 2018-07-30 20:18:06 +02:00
ae2e2386ac New grease pencil transform icons
Designed by Matias Mendiola
2018-07-30 20:16:23 +02:00
Nick Wu
002712d04c Merge branch 'soc-2018-npr' of git.blender.org:blender into soc-2018-npr
# Conflicts:
#	release/scripts/startup/bl_ui/properties_scene.py
2018-07-30 23:20:28 +08:00
Nick Wu
927c7aae0d Added init code for default LANPR values. Fixed render and scene panels to accept LANPR engine. 2018-07-30 23:19:17 +08:00
1e45155e7a Change icon names to define custom grease pencil icons
The standard icons for these operators don't fit in the grease pencil use and it's better to have icons more designed for grease pencil strokes.
2018-07-30 16:30:43 +02:00
480abbe839 Fix: Ensure that LANPR panel is only enabled when that engine is enabled
- Fixed incorrect COMPAT_ENGINES define

- Removed poll() callback that was preventing the COMPAT_ENGINES
  set from working

- Have panel opened by default (since it doesn't need to stay collapsed
  when other engines are active anymore)
2018-07-31 02:05:13 +12:00
91a4d28a1c Example commit for fixing panel visibility when LANPR is enabled
Following the examples here (for the Scene/KeyingSet settings),
all general non-engine-specific panels should include "BLENDER_LANPR"
in the COMPAT_ENGINES set.
2018-07-31 02:03:47 +12:00
277a7a527f Automatically refresh viewport when changing LANPR settings
Use the messagebus struct-subscription methods here (as used for EEVEE settings)
so that changing rendering methods or other settings immediately refreshes
the viewport instead of requiring the user to click on the viewport to force
a redraw.
2018-07-31 01:51:31 +12:00
4c088075f0 Fix compiler warnings (use 0 in enums for no icon, not NULL) + whitespace (mixed tabs/spaces) 2018-07-31 01:44:54 +12:00
ff471c95fc Compile Fix: Branch now compiles when WITH_OPENSUBDIV is disabled 2018-07-31 00:54:51 +12:00
9ce69d83d1 Adjusted vertex wig and edge flip opti 2018-07-30 14:39:58 +02:00
1c04f26efd Fix missing parameter after merge 2018-07-30 14:39:23 +02:00
8303df3b4e Merge branch 'blender2.8' into greasepencil-object 2018-07-30 14:25:44 +02:00
28c08117ef UI: Hide Opacity and Thickness in Annotations panel
We hide these parameters while we decide if they are required or not, but now it's better keep hidden.
2018-07-30 13:48:34 +02:00
0ad8b25cca Merge branch 'blender2.8' into greasepencil-object 2018-07-30 12:55:18 +02:00
Nick Wu
67d1949c5b Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	release/scripts/addons
#	release/scripts/addons_contrib
2018-07-30 18:27:46 +08:00
Nick Wu
63921c65e9 changed most of the list API into BLI_'s. Removed many unused functions 2018-07-30 18:26:39 +08:00
56f3473b85 Cleanup: remove unused code 2018-07-30 10:51:21 +02:00
76c3335c9d Cleanup: use __func__ for mallocN identifier 2018-07-30 18:47:16 +10:00
8aa1af5bc2 Cleanup: unused warnings, right shift 2018-07-30 18:31:13 +10:00
4e09b80fb0 UI: Changes in some text in Overlay panel 2018-07-29 20:48:28 +02:00
c00ec472ef Cleanup: Fix typo error 2018-07-29 17:33:27 +02:00
e0ae593a7c Set default values for Grid and Fade 2018-07-29 17:30:10 +02:00
9399ae1697 Change Grid to work as 3D Grid
Now the scale is the size and the subdivisions the number of cuts inside this "bounding box"
2018-07-29 17:21:38 +02:00
5ec0745e49 Fix first edit mode change with TAB key
The operator assumed the object editable was using always OB_MODE_EDIT, but for grease pencil the mode must be OB_MODE_GPENCIL_EDIT
2018-07-29 16:13:19 +02:00
aa503b5913 UI: Use slider type for grid opacity and fade factor 2018-07-29 15:51:50 +02:00
bfd27bfcc7 Fix TAB key to toggle Edit mode
This key was removed by error in the past.
2018-07-29 12:43:04 +02:00
5ef8b72d15 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/addons
2018-07-29 12:24:34 +02:00
a4023605dc Change number of subdivision to avoid int division problem in Grid
Before, if you selected 5 subdivisions, the number of boxes in the grid was 5/2= 2, so the odds values were not working.

Now, the subdivisions means the number of boxes in each side of the symmetry line 5= (5 Right side + 5 Left side) = 5 * 2 = 10 Boxes.
2018-07-29 12:22:43 +02:00
44bb85b919 UI: Reorder Grid parameters 2018-07-29 12:02:17 +02:00
1545203d86 Update Grid when change lock axis 2018-07-29 11:48:59 +02:00
94c459147e Enable grid when play animation 2018-07-28 20:42:07 +02:00
2198cd5067 Cleanup: Move view settings to overlay struct 2018-07-28 20:41:04 +02:00
bdeceba5f6 Add Lock to axis and opacity control to grid
Now, the grid axis can be automatically set to the current lock axis
2018-07-28 17:58:27 +02:00
e33a16317d Minor changes to grid
- Use half number of lines in loop to be equal UI parameter
- Cleanup typo errors
- Change default number of lines
2018-07-28 16:43:49 +02:00
d157584f59 Enable grid in different axis
Before only Y axis was supported.
2018-07-28 16:29:49 +02:00
ff683fc86b Merge branch 'blender2.8' into greasepencil-object 2018-07-28 12:08:06 +02:00
e920e1335d Full refactor of Grease Pencil grid
After testing the old grid locked to view, the artist found that old system was not usable and they requested a grid locked to grease pencil object.

Also fixed some problems with fade object
2018-07-28 12:02:29 +02:00
d977db77cd UI: Change old Grease Pencil Paper and remove color
Now, the color is always white. We still keep internally the color field because maybe we reuse it in the future.
2018-07-27 21:13:48 +02:00
3dbbaf15be Initial work on edge wiggle rewrite 2018-07-27 17:27:44 +02:00
eacc4ae316 Separate Paper and Grid and rename 2018-07-27 16:58:51 +02:00
6c68bea576 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/makesdna/DNA_view3d_types.h
2018-07-27 16:39:36 +02:00
d9e7a9ad5f Fix snap operator
There was a problem updating the scene due depsgraph missing tags
2018-07-27 16:27:55 +02:00
e4da722dd7 UI: Move draw on back button after lock options 2018-07-27 16:13:33 +02:00
5d060c3fb9 UI: Remove menu icons 2018-07-27 16:06:39 +02:00
65bc541f5d Implement Presets for Brush options
This is the first step to create a set of predefined settings.
2018-07-27 16:04:57 +02:00
6c8485ceec UI: Add additive drawing option to top header
This option was a menu option and must be a switch.
2018-07-27 13:13:42 +02:00
Nick Wu
9218730b2b DPIX and Snake's F12 is working now. 2018-07-27 18:17:18 +08:00
a6263a3c02 Merge branch 'blender2.8' into greasepencil-object 2018-07-27 12:16:07 +02:00
5d3082aa61 UI: Move lock options to Left Top Header
These options were not tool parameters but a general option, so we move to the same UI location used in mesh sculpt.
2018-07-27 12:15:21 +02:00
d7c410971f UI: More changes in menus 2018-07-27 12:03:22 +02:00
bb69ff8943 UI: Replace Weight Paint menus
Also some preparation for other modes
2018-07-27 12:03:22 +02:00
12ed26444e Fix: Forgot to rename a few properties in earlier RNA/DNA commit 2018-07-27 21:24:08 +12:00
Nick Wu
e941813e3c Debugging small problem in threads, in lanpr_triangle_line_imagespace_intersection_v2() 2018-07-27 15:53:13 +08:00
81b971b154 Fix: Refresh issues in Topbar with Grease Pencil and Annotations 2018-07-27 16:44:38 +12:00
a2dcac0a02 Cleanup: Remove unused code 2018-07-27 16:29:11 +12:00
aa8b7f4368 RNA/DNA changes to further decouple Grease Pencil and Annotation settings where clashes occurred
* Decouple stroke placement settings for 3D view
* Ensure that proper thickness controls are used in the topbar
2018-07-27 16:29:11 +12:00
f4f5c1152c Fix: Don't show GP Object's layer data in the Annotation topbar settings 2018-07-27 16:29:10 +12:00
Nick Wu
4ef26d98d3 Fixed intersection calculation memory leak, fixed snake UI error, added F12 supporting functions. 2018-07-27 11:41:16 +08:00
0300f6ee03 Merge branch 'blender2.8' into greasepencil-object 2018-07-26 22:28:38 +02:00
c581207556 Merge branch 'blender2.8' into greasepencil-object 2018-07-26 08:26:41 +02:00
Nick Wu
68374d3838 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-07-26 10:09:40 +08:00
7e0de88ce2 Merge branch 'blender2.8' into greasepencil-object 2018-07-25 20:39:12 +02:00
Nick Wu
d250cd950b Typo fix finalColor 2018-07-25 22:49:14 +08:00
Nick Wu
dd5fcd4d0f Fix camera access error, added report to no camera situation. 2018-07-25 22:25:18 +08:00
Nick Wu
3353221166 Fix code for strict compile. 2018-07-25 22:15:18 +08:00
0383854870 UI: Remove transform orientation options in Sculpt mode 2018-07-25 16:01:18 +02:00
ddd32b09ec UI: Hide snap options in Paint, Sculpt and Weight mode 2018-07-25 15:57:06 +02:00
0eb95d6ebc UI: Remove duplicated menu items
Some options were duplicated by error in previous commit.
2018-07-25 15:34:25 +02:00
b2d0bdf878 Merge branch 'blender2.8' into greasepencil-object 2018-07-25 13:21:39 +02:00
5417c39564 UI: Move Shapes panel to Header 2018-07-25 13:20:44 +02:00
6ef94c6407 UI: Remove more old Toolbar panels
The options has been moved to header or menu
2018-07-25 12:47:57 +02:00
bdf4967db7 UI: First changes in Edit Toolbar
- Add transform tools
- Move Bend, Mirror, Shear and ToSphere as Tools
2018-07-25 11:53:58 +02:00
Nick Wu
ea8f7878f6 Added debug shaders to find problems in f12 2018-07-25 16:43:30 +08:00
Nick Wu
88448dba15 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-07-25 13:43:14 +08:00
9afed02356 Annotation Eraser: Only erase the point within the cursor, not the whole segment 2018-07-25 16:46:43 +12:00
171e231a8a Fix: Crash in non-3d editors when using Annotations
The wrong shader was being used after removing the per-point
varying colors.
2018-07-25 16:39:56 +12:00
f806dd9bfc Merge branch 'blender2.8' into greasepencil-object 2018-07-24 22:16:26 +02:00
f0eaacc343 Change order of modes to reorder Pie menu
The Draw now is on N option and not in NW. In this way is easier change the most common modes (N, S, E, W)
2018-07-24 18:17:32 +02:00
d5c7fd54fd T55445: Add custom properties panel to materials 2018-07-24 16:45:54 +02:00
705b0631b3 UI: Harmonize Toolbar parameters
Some parameters have been moved to toolbar and removed from header.
2018-07-24 12:54:01 +02:00
bb66837116 Back opacity to annotations
This parameter is usefull to reduce visibility of annotations and was removed by error in a previous commit.
2018-07-24 11:30:26 +02:00
Nick Wu
7fa715cfb7 Modified UI for chaining. 2018-07-24 16:57:29 +08:00
2439ca1529 Merge branch 'blender2.8' into greasepencil-object 2018-07-24 10:57:16 +02:00
bd3f7816f9 UI: Improve Toolbar icons (group)
Now it's possible group new brushes
2018-07-24 10:53:53 +02:00
Nick Wu
483d5d7c93 Fixed c function and glsl file names. 2018-07-24 15:30:06 +08:00
a54c30da76 Hacky fix for Mode Switch Pie Menu overflowing to a submenu on GP Objects
With the introduction of the GP editing modes to the object/workspace
modes enum, this introduced a number of issues for the Ctrl-Tab mode
switching pie menu, e.g.
 * To access any of the GP Editing modes, you had to first navigate to
   the "More" sub-pie, before being able to see these values. In practice,
   this was tricky to use, and not ideal.
 * Particle Editing mode was also moved into a sub-pie by itself

This was due to the following reasons:
 1) Pie Menus for Enums use the "static" enum define to determine
    where items should go.  This was done to ensure spatial consistency
    of items (e.g. Edit is always in the "east" position).
 2) Each pie menu layout is only allowed to contain 8 items.
    (i.e. so that movements can be less precise, corresponding to the
    main compass directions only)
 3) The nature of the modes menu means that there is never any situation
    where all menu items need to be visible at the same time. Usually,
    there are only between 2-5 items in that menu at a time, and at least
    6 of the items are only valid for a single object type each.

Several other solutions were tried, but this hack is the simplest fix.
2018-07-24 17:47:28 +12:00
c8cf0e10e0 Annotations: Show "Stroke Placement" options in the topbar again
We may have to introduce a dedicated setting here for use with the
annotation tools, since the GP Object version is quite different now.
2018-07-24 17:25:54 +12:00
dc215a5851 Annotation Tools: Use different cursors to indicate that the tools are running 2018-07-24 17:25:54 +12:00
091db5fb96 Assorted Cleanup/Fixes 2018-07-24 17:25:53 +12:00
846f5d8f74 Annotations: Dynamically updating layer-color preview icons + "Active Note" enum
This adds a new enum with dynamically-generated icons to show previews
for the icons associated with each GP layer used for annotations. This
enum is used as part of the UI for annotations (specifically, in the
topbar settings for the active  tool), making it easier for users to
see what color strokes drawn using the active note/layer will look like.

I ended up needing to create a new icon type in BKE_icons.h so that
we can store references to the layer/color used.

Known issues:
* The icon seems a bit too big, and would look a bit nicer with
  rounded corners. But there are too many issues with the UI roundbox
  functions (e.g. _aa() makes colors too dark, and non-aa versions look
  too rough).

* Changing layer colors doesn't redraw the icons. A manual refresh
  (by mousing over the widget) is needed.
2018-07-24 17:25:53 +12:00
1b47790111 Cleanup: Whitespace 2018-07-24 17:25:51 +12:00
d62a48411d Cleanup: Remove need to set colors on each and every annotation point when drawing 2018-07-24 17:25:51 +12:00
Nick Wu
3f7d07ac97 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-07-24 10:12:03 +08:00
d3c463b6f5 Fix duplicate Brush in tool bar 2018-07-23 21:17:50 +02:00
8ad523b885 Merge branch 'blender2.8' into greasepencil-object 2018-07-23 20:28:04 +02:00
0050fc1cb5 UI: Improve brush toolbar
This is a temp solution to show all brushes and sort by use, not alphabetical.

This will be replace when new tool bar system is in place.
2018-07-23 20:27:20 +02:00
0b99dc1b25 Fix duplication error for Brushes
This produced an error when create a new brush and a memory leak when closed Blender.
2018-07-23 17:06:54 +02:00
Nick Wu
e406c67842 Provide a switch to enable chaining or not. 2018-07-23 22:33:59 +08:00
c013752625 Merge branch 'blender2.8' into greasepencil-object 2018-07-23 15:47:50 +02:00
Nick Wu
1ddd3d60bf Chain support line types and levels.
Still bugs in chaining, hard to find, but results good enough in most of the conditions.
2018-07-23 17:57:34 +08:00
610013da70 Clenup: Remove old unused code 2018-07-23 10:13:41 +02:00
5927e4cba4 Merge branch 'blender2.8' into greasepencil-object 2018-07-23 09:53:01 +02:00
Nick Wu
9f344c6b88 Merge and changed GWN APIs into GPU ones. 2018-07-23 11:34:30 +08:00
Nick Wu
aa6563d3a9 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	release/scripts/startup/bl_ui/space_view3d.py
#	source/blender/draw/intern/draw_manager.c
2018-07-23 10:55:48 +08:00
353c5a1c79 Merge branch 'blender2.8' into greasepencil-object 2018-07-22 12:15:31 +02:00
7201126e84 Merge branch 'blender2.8' into greasepencil-object 2018-07-21 14:21:17 +02:00
e0fc790da2 Merge branch 'blender2.8' into greasepencil-object 2018-07-21 14:14:05 +02:00
2d3a3d2241 Revert temp fix for materials preview 2018-07-20 22:30:22 +02:00
a7765d3511 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/render/render_preview.c
2018-07-20 22:19:59 +02:00
e2204f3fc5 Merge branch 'blender2.8' into greasepencil-object 2018-07-20 19:44:05 +02:00
768cb61181 Fix segment fault with material previews
This fix solves the issue with multiple previews at the same time. Maybe there wll be a more general solutions in render preview module, but we need keep the system running.
2018-07-20 19:43:15 +02:00
Nick Wu
67fa286f11 Fix render triangle size increment error. 2018-07-20 23:27:28 +08:00
Nick Wu
227c259873 Fix fileread error again. 2018-07-20 22:41:39 +08:00
Nick Wu
b3cea139a8 Fix taper on segment_count==1 situation 2018-07-20 22:26:32 +08:00
Nick Wu
efe7257a20 Fix detail reducing bugs 2018-07-20 22:14:02 +08:00
Nick Wu
b421eaa36d Chain first level preview ok. Simplification have bugs. 2018-07-20 21:06:36 +08:00
b7d2a47c06 Merge branch 'blender2.8' into greasepencil-object 2018-07-20 13:33:52 +02:00
ea0668e387 Remove unedeed flag in notifier 2018-07-20 11:53:52 +02:00
46f79f3f75 New version of Toolbar Icons 2018-07-20 09:09:22 +02:00
4eb3b3ce90 Fix Paint mode icons 2018-07-19 21:21:00 +02:00
c656a6dd6a Merge branch 'blender2.8' into greasepencil-object 2018-07-19 20:54:39 +02:00
9bacd9e3c9 Fisrt try of new Toolbar icons (WIP)
Designed by Matias Mendiola

Still problems with Paint Toolbar
2018-07-19 20:53:42 +02:00
Nick Wu
aceecd1749 Intersection chain now ok. (occlude level debug wait until tomorrow) 2018-07-19 23:44:30 +08:00
371b127043 Merge branch 'blender2.8' into greasepencil-object 2018-07-19 10:09:33 +02:00
Nick Wu
8bb97b6318 Fixed not updating normal error. now all lines properly calculated. 2018-07-19 15:50:50 +08:00
Nick Wu
4719b8f561 Fix occlusion error 2018-07-19 13:51:01 +08:00
1dbfd266a1 Tons of changes to fix GPU_* functions rename 2018-07-18 20:47:52 +02:00
b98e6d7742 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/draw/intern/draw_cache.c
	source/blender/editors/gpencil/drawgpencil.c
	source/blender/editors/gpencil/gpencil_brush.c
2018-07-18 20:18:09 +02:00
1334f3639c Cleanup: Reorder modifier list 2018-07-18 20:13:13 +02:00
3260ab8a7f New Mirror modifier
Still some functions not implemented, but the basic functionality is in place.
2018-07-18 19:42:18 +02:00
Nick Wu
3b52d6c72c Chain works, but occlusion is broken. (memory not cleaned up, drawing function is still the old one) 2018-07-18 23:49:14 +08:00
Nick Wu
ac74aa8d7f Fix typo, added to cmake, compile ok. 2018-07-18 16:42:05 +08:00
Nick Wu
7431839712 Chain now accept line segments (multiple occlusion level on one line is possible) 2018-07-18 16:20:21 +08:00
7a2617a6a8 Fix soft/hard limit warning 2018-07-18 10:00:31 +02:00
3537020110 Merge branch 'blender2.8' into greasepencil-object 2018-07-18 09:05:04 +02:00
Nick Wu
4b67aa4848 Implementing Chaining. Have problems for half-occluded line. Still thinking for solution. 2018-07-18 14:54:24 +08:00
8ce5bdffca Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2018-07-17 20:27:37 +02:00
Nick Wu
1313409e67 Merge branch 'soc-2018-npr' of git.blender.org:blender into soc-2018-npr
# Conflicts:
#	source/blender/draw/engines/lanpr/lanpr_chain.c
2018-07-17 23:23:23 +08:00
Nick Wu
4069c15759 Implementing software result chaining. Do NOT compile! 2018-07-17 23:21:28 +08:00
1892434c47 Merge branch 'blender2.8' into greasepencil-object 2018-07-17 15:37:00 +02:00
cca1d1038f Fix problem with preview for not visible materials
The preview must be generated with the color enabled and not checking the current scene settings. If we don't do this, the preview is empty for these materials.
2018-07-17 15:08:19 +02:00
Nick Wu
07cb51e074 Implementing software result chaining. Do NOT compile! 2018-07-17 17:26:30 +08:00
369816e531 Change RNA update to avoid unnecessary preview updates 2018-07-17 11:21:53 +02:00
a633737d93 Merge branch 'blender2.8' into greasepencil-object 2018-07-17 11:12:00 +02:00
Nick Wu
67ac0da53c Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-07-17 15:34:14 +08:00
Nick Wu
78277fe3f8 Merge branch 'npr_tess' of https://github.com/DarkDefender/blender into soc-2018-npr
# Conflicts:
#	intern/opensubdiv/opensubdiv_capi.h
#	intern/opensubdiv/opensubdiv_evaluator_capi.cc
#	source/blender/modifiers/intern/MOD_mybmesh.c
2018-07-17 15:33:54 +08:00
c617cb11ce Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/draw/modes/object_mode.c
2018-07-16 22:25:26 +02:00
5b5d80e864 Invert thumbnail switch to make UI more consistent
Also changed icon.
2018-07-16 18:21:22 +02:00
ef49c6368a Visual Studio compile fixes 2018-07-16 17:19:27 +02:00
917ea324d0 Add delete button to Color Preview list
This makes the control more consistent and avoid flickering when change list mode.
2018-07-16 16:31:00 +02:00
Nick Wu
1ce41b9726 File RW OK 2018-07-16 22:25:06 +08:00
751c8dfce3 UI: Replace color by material previews in list
To make more consistent the UI, the list of colors must shows the preview, not the old color boxes.

Besides, the new materials are more complex that a simple color box and the image was not representative.
2018-07-16 16:22:19 +02:00
f895b3e6ea Merge branch 'blender2.8' into greasepencil-object 2018-07-16 16:03:30 +02:00
915e414c86 Use live icons to template_ID for graese pencil materials 2018-07-16 13:54:22 +02:00
5cd39ced65 Add new parameter to template_ID to use live icon in button
By default, the button uses a predefined fixed icon, but in some situations it's better to show the preview (materials)
2018-07-16 13:51:40 +02:00
260ee7a770 update to new OSD API again 2018-07-16 13:10:59 +02:00
1ab1b4c1d8 Update to new OSD blender API 2018-07-16 12:01:40 +02:00
56d0fcbb66 Fixed camera object tranformation matrix 2018-07-16 12:01:40 +02:00
4268554f12 Make vertex wig sampling reflect the method in the paper 2018-07-16 12:01:40 +02:00
937b491943 Added time reporting and optimized osd_eval creation 2018-07-16 12:01:40 +02:00
09d0db2654 Initial port to 2.8 2018-07-16 12:01:21 +02:00
daeb641d42 Remove console warnings for tool bar
This will chanage in the future, but we can keep running without warnings with the current implementation.
2018-07-16 11:45:31 +02:00
7d22f617dd Update Icon for materials when change something
Need update icon for compact list. becaus ethe thumbnail is not used.
2018-07-16 11:11:30 +02:00
f1d0c41dcf Add missing weight data management in RNA function
This code was missing in the initial fix.
2018-07-16 10:01:28 +02:00
e386d627f6 Cleanup: Remove duplicate code 2018-07-16 09:33:19 +02:00
4faa243dd6 Cleanup: Make RNA callback names more consistent with the general naming scheme used 2018-07-16 18:41:04 +12:00
d94a9f5fbb RNA: Material filtering for GP Brush Settings 2018-07-16 18:41:04 +12:00
3c1c626916 Merge branch 'blender2.8' into greasepencil-object 2018-07-16 08:37:46 +02:00
Nick Wu
84c0f57d35 Code style fixes. Uncrustify processed. 2018-07-16 14:35:01 +08:00
39886fbb92 RNA: Filter "normal" materials vs "GP Object" ones 2018-07-16 17:57:57 +12:00
3a82de14d1 RNA: Add pointer poll callbacks so that Annotation datablocks don't get used for GP Objects and vice versa 2018-07-16 17:05:31 +12:00
Nick Wu
6af71e8176 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
# Conflicts:
#	intern/opensubdiv/opensubdiv_evaluator_capi.cc
#	release/scripts/startup/bl_ui/properties_scene.py
2018-07-16 10:44:49 +08:00
Nick Wu
8bb1a5396e Fixed OpenSubdiv_FVarLinearInterpolation type error. 2018-07-16 10:05:30 +08:00
5249e4bb11 Add switch to chnage betwen thumbnails and list
Now it's possible to change between a compact list of colors or the default thumbnail mode.
2018-07-15 21:34:23 +02:00
86965e51e9 Fix function names after merge
The functions have a new name now.
2018-07-15 17:19:52 +02:00
a5a0bc33a5 Merge branch 'blender2.8' into greasepencil-object 2018-07-15 16:59:04 +02:00
96831600bb UI: Change default previews to 80% 2018-07-15 16:23:03 +02:00
c846fa132d Add new Scale parameter to template_greasepencil_color
Now it's possible to define the size of the previews.
2018-07-15 14:12:38 +02:00
6f4849c22b UI: Fix some error in previous commit
Also rearrange some buttons.
2018-07-15 11:53:55 +02:00
14f5c40b80 UI: Use icon for Material Link
Follow the same UI design used in commitd2b28a8bf1b4d5abd9507e02702c6dc511ccf2c6
2018-07-15 11:46:14 +02:00
8664f667b2 Merge branch 'blender2.8' into greasepencil-object 2018-07-15 11:37:35 +02:00
84567336a5 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	build_files/cmake/macros.cmake
	source/blender/editors/space_view3d/view3d_edit.c
	source/blender/makesrna/intern/rna_scene.c
	source/blender/makesrna/intern/rna_space.c
2018-07-15 09:14:14 +02:00
d9526e5cb6 UI: Change preview row number to 3 2018-07-14 20:55:58 +02:00
f932d7863d Fix overlay panel missing in Edit/Sculpt/Weight Paint 2018-07-14 20:49:31 +02:00
57e0ebdba1 New preview file for grease pencil
Designed by Matias Mendiola
2018-07-14 20:48:40 +02:00
4eafa4f26a New property to verify if the material is grease pencil type 2018-07-14 17:14:39 +02:00
2b0a83bc78 UI: Make list of colors preview more compact 2018-07-14 16:15:26 +02:00
27ba739fb7 Merge branch 'blender2.8' into greasepencil-object 2018-07-14 13:44:14 +02:00
231e894a7e Update preview panel for grease pencil materials
Also some test changes to preview_grease_pencil.blend file
2018-07-14 13:41:17 +02:00
96cdb57d6f Clenup: PeP8 2018-07-14 13:07:05 +02:00
965c723eb4 UI: Add previeww materials panel to grease pencil 2018-07-14 13:06:27 +02:00
998a9a0322 Remove Grease Pencil Color Picker
This operator has been replaced by the new preview system.
2018-07-14 12:46:21 +02:00
cb01afc0b1 Update previews when change material
Also split rna update for grease pencil parameters
2018-07-14 12:17:42 +02:00
abab0398a0 Fix grease pencil cache update problems when change material properties
Since commit f84956738b 6/07/2018 12:33, the update of the materials was not working because depsgraph only update the current ID and not all related.

This fix the issue but need a review.

@aligorith Could you take a look and check if this is the best solution, I'm not sure about the fix, maybe we could add a relationship between material and datablock when create a new material.
2018-07-14 11:13:33 +02:00
2d90ef872a Fix merge error and remove old code
This file was wrong from a previous merge and still had code about grease pencil modifiers that was not deleted when the GP modifiers were splitted.
2018-07-14 10:05:31 +02:00
122c375d6e Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/object/object_modifier.c
2018-07-14 09:42:03 +02:00
915b63c95f WIP: Define a new preview blend file for grease pencil
The blend file is only a copy of old file. Put only as placeholder.
2018-07-13 20:12:32 +02:00
Nick Wu
27628fa68c Merge branch 'npr_tess' of https://github.com/DarkDefender/blender into soc-2018-npr-tess-modifier 2018-07-13 23:05:34 +08:00
Nick Wu
8dbc12864e Modify code to standard api and style 2018-07-13 23:05:16 +08:00
ad60c90c9a Merge branch 'blender2.8' into greasepencil-object 2018-07-13 15:51:47 +02:00
1471c5a2ec Merge branch 'blender2.8' into greasepencil-object 2018-07-13 12:29:06 +02:00
46453b13e8 Merge branch 'blender2.8' into greasepencil-object 2018-07-13 10:33:52 +02:00
5432109170 Move depsgraph tag after brush creation
If the brush was created, the tag was not working because it was done before the brush was available.
2018-07-13 10:33:07 +02:00
3808776a86 Move Overlay options to View3DOverlay
It's better to keep all overlays in the same RNA.
2018-07-13 10:28:02 +02:00
fff4676feb Replace "Notes" by "Annotations" to keep UI consistency
We can not use the word "Notes" in the UI for annotations because it creates confusion for the user.
2018-07-13 10:14:56 +02:00
d6eccc1361 Change some old grease pencil code to annotation
Fixed the error in annotation panel for other editors.

The main Notes switch for 3D View has been removed of the Notes panel because must be in the overlays.
2018-07-12 19:50:33 +02:00
6780be066f Move annotations switch to Overlay struct 2018-07-12 19:27:13 +02:00
edfcaea299 UI: Add again show annotation overlay switch
This was removed by error in a previous merge.
2018-07-12 19:20:32 +02:00
78ddb3c5f1 Update to new OSD blender API 2018-07-12 17:45:51 +02:00
c775facfd8 Update depsgraph to active brush from toolbar
There is a problem with the synchronization of the brush if it's selected from toolbar.

This change maybe can be removed when new toolbar system will be ready, but we need it now to keep drawing brushes working.
2018-07-12 17:35:29 +02:00
f2852b4c14 Revert "Revert "OpenSubdiv: Make more flexible C-API to specify FVar interpolation""
This reverts commit 14c72f943a.
2018-07-12 17:31:45 +02:00
3caae7707f Revert "Revert "OpenSubdiv: Fix wrong topology refiner cast""
This reverts commit 551f181742.
2018-07-12 17:29:38 +02:00
bbe59591d0 Revert "DO NOT MERGE - revert opensubdiv commit 9a0634a253421c02dbb6d2864db49e4d382ea2a3"
This reverts commit 87ed11f0a7.
2018-07-12 17:29:11 +02:00
23a870a0a9 Merge branch 'blender2.8' into greasepencil-object 2018-07-12 16:23:21 +02:00
c9026b8802 Merge branch 'blender2.8' into greasepencil-object 2018-07-12 09:09:00 +02:00
ac46f45e5c UI: Hide old Tools panels: Animation and Shapes
Pending to decide where put these operators.
2018-07-11 21:36:18 +02:00
28ed04b367 Merge branch 'blender2.8' into greasepencil-object 2018-07-11 19:18:31 +02:00
3bab9673ae UI: Hide color picker operator in Top bar
This operator will be replaced by material preview selector.

We keep the code internally now, but it will be removed when the preview works fine.
2018-07-11 19:18:02 +02:00
Nick Wu
6e3726439b Merge branch 'npr_tess' of https://github.com/DarkDefender/blender into soc-2018-npr-tess-modifier 2018-07-11 23:14:48 +08:00
Nick Wu
93113d9b77 modify the code to adapt VC and some API changes. 2018-07-11 22:51:36 +08:00
a51b0fd81c Fixed camera object tranformation matrix 2018-07-11 16:43:59 +02:00
86b53f79d3 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/properties_scene.py
	release/scripts/startup/bl_ui/space_view3d.py
	source/blender/editors/space_view3d/space_view3d.c
2018-07-11 16:28:59 +02:00
a74a8dfede New template for grease pencil material previews
This is the initial step to prepare the use of material previews in the topbar as color selector.

We need a new template to hide some elements of the default template.

Still the preview of the material is not available.
2018-07-11 16:21:13 +02:00
b24fec55a4 UI: Add different parameter to TopBar for each type of brush 2018-07-11 15:48:29 +02:00
b662ff5cae UI: Make Tool text shorter and less repetitive 2018-07-11 15:41:51 +02:00
652826dc77 Fix broken Tools group by previous commit.
The commit f468302660 broke the groups for mesh tools.

This is a temp hack to make the tools work, but need a better solution.
2018-07-11 15:30:52 +02:00
d4b7d488ff Fix error in toolbar for mesh modes
The category array must be shared.
2018-07-11 13:26:20 +02:00
25b95b2736 Replace text for Show/Hide panel
Before the name was too long, but with new design is ok.
2018-07-11 13:21:43 +02:00
Nick Wu
51df987a06 Merge branch 'npr_tess' of https://github.com/DarkDefender/blender into soc-2018-npr-tess-modifier 2018-07-11 17:14:02 +08:00
0dfc34d2b5 Make vertex wig sampling reflect the method in the paper 2018-07-11 10:42:10 +02:00
8cc727b6c6 Added time reporting and optimized osd_eval creation 2018-07-11 10:42:10 +02:00
87ed11f0a7 DO NOT MERGE - revert opensubdiv commit 9a0634a253 2018-07-11 10:42:10 +02:00
893633527d Initial port to 2.8 2018-07-11 10:42:10 +02:00
14c72f943a Revert "OpenSubdiv: Make more flexible C-API to specify FVar interpolation"
This reverts commit c17cb50ae2.
2018-07-11 10:41:20 +02:00
551f181742 Revert "OpenSubdiv: Fix wrong topology refiner cast"
This reverts commit d0920fba16.
2018-07-11 10:41:08 +02:00
8dc7c6bc47 Fix problem with Eraser cursor
The blend modes were using the GPU functions but the parameters were the old GL mode.
2018-07-11 10:25:21 +02:00
e93a1db8ec GPU replace missing in previous commit 2018-07-11 10:03:28 +02:00
457934c247 Replace gl* functions by GPU* 2018-07-11 10:01:11 +02:00
Nick Wu
ee788360cc Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-07-11 15:03:52 +08:00
1b32fa0ef5 Merge branch 'blender2.8' into greasepencil-object 2018-07-11 08:34:35 +02:00
f468302660 Fix: All GP Paint brushes were getting added to the same group in the toolbar 2018-07-11 17:13:23 +12:00
20bdf114a5 WIP: Add Brush drawing settings to topbar 2018-07-10 19:36:58 +02:00
e03a04dec7 WIP: Set Paint toolbar
Still the bushes are inside same category
2018-07-10 19:25:03 +02:00
a3e7590bb8 Merge branch 'blender2.8' into greasepencil-object 2018-07-10 18:05:02 +02:00
09078d12c3 WIP: More changes to try to get Draw tools
Still not working
2018-07-10 17:00:56 +02:00
2bff2a33b4 Do not include object type in name for Brush enums 2018-07-10 16:35:51 +02:00
ffa21e7417 WIP: Changes to make Sculpt and Weight paint tools work
This is a temp solution while we get the new toolsystem in place
2018-07-10 16:02:44 +02:00
db6d0ca6e9 Undo context changes
This can be needed by pending areas.
2018-07-10 13:29:14 +02:00
bf6c5e935e WIP: More work in toolbars (still not working) 2018-07-10 12:04:11 +02:00
3583c3f8dd Move GPENCIL_PAINT context inside tools switch 2018-07-10 11:59:57 +02:00
4ca18ac8cd Set icon for Brush enum 2018-07-10 11:53:34 +02:00
659254c2d0 Create Enum with all Grease Pencil Drawing Brushes 2018-07-10 11:50:16 +02:00
ae6036e371 Add property to check brush type
This is required by Tool system.
2018-07-10 11:11:04 +02:00
4d67d4bfc9 Remove annotation tool in Sculpt
This tool is not logic here
2018-07-10 10:36:01 +02:00
73a191d0cb WIP: Initial steps to implement Sculpt brushes in Toolbar
This is not working yet and can produce segment faults.
2018-07-10 10:11:47 +02:00
b6b6ee3134 UI: Remove obsolete function 2018-07-10 10:11:47 +02:00
7a40a8c0ef Cleanup/Fixes
* Remove hack that's no longer needed

* Don't change the GP Eraser Size userpref property from GP Object
  drawing operator, as it doesn't use that anymore. Instead, the
  eraser brush's size gets adjusted instead.
2018-07-10 19:52:23 +12:00
0e967bfb76 Toolbar: Move Ruler into same group with Annotations (but as separate buttons)
This way, the items group up nicer when you have the 2 column
icon groupings.
2018-07-10 19:13:10 +12:00
a77c3d5cb3 Fix: Pinning GP Object data in Properties Editor wasn't showing the GP Data tab 2018-07-10 18:52:21 +12:00
a2d7cb8c75 Merge branch 'blender2.8' into greasepencil-object 2018-07-10 08:05:18 +02:00
e9f21519fe Fix building & linking on Linux 2018-07-10 08:04:47 +02:00
fe98aed876 Cleanup: Remove GPENCIL_OT_color_choose
This isn't used anywhere, and should really even need to be
used for any purpose.
2018-07-10 17:25:40 +12:00
76c80cf124 Annotations: Don't display Annotations properties panel when GP data in context is for GP Object 2018-07-10 17:21:59 +12:00
2c609f6175 Fix: Don't allow Annotation tool to paint on GP Objects and vice versa 2018-07-10 15:44:30 +12:00
e7dc57438a Merge branch 'blender2.8' into greasepencil-object 2018-07-10 14:49:22 +12:00
0c830cf90e Merge branch 'blender2.8' into greasepencil-object 2018-07-09 20:35:36 +02:00
d3afa14647 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/space_view3d.py
2018-07-09 17:17:05 +02:00
cd12b15756 Make Ruler works with Annotations not Grease Pencil object
Now, the ruler is using the annotation datablock (scene) and not a object with materials
2018-07-09 15:45:13 +02:00
117d304a90 Tweaks to GPENCIL_OT_new operator
* Correctly tag Annotation datablocks as such when adding them
* Add new layer by default. It saves users from having to manually
  add one after adding the datablock anyway.
2018-07-10 00:20:19 +12:00
c56e3bcb6f Fix: "New Note" didn't tag newly-created GP datablock for annotations when creating a new datablock 2018-07-09 23:47:33 +12:00
60d2ff134e Cleanup: Use GPU_* calls instead of gl* in annotate_draw.c 2018-07-09 23:28:02 +12:00
d884d41d17 Annotations: Change "New Layer" label to "New Note" 2018-07-09 23:15:51 +12:00
85f7f0fddf Make Annotations toggleable with main overlay switch 2018-07-09 10:47:56 +02:00
c8943925e5 Rename Grease Pencil to Annotation
Some properties and flags are more clear if the name is annotation.

Also changed some text and tooltips.
2018-07-09 10:37:44 +02:00
ff20577420 Merge branch 'blender2.8' into greasepencil-object 2018-07-09 09:49:19 +02:00
995a573d30 User Prefs: Make it clearer which properties affect Annotations only vs GP + Annotations 2018-07-09 19:45:21 +12:00
9cfd0c1720 Annotations: Change default color for new annotation layers
Although we've had a default color for new Grease Pencil layers for
years, hardly anyone ever changed the default color from the old
default of black. This commit changes this default to match the
color used in the annotation pencil icons, giving it a stronger
connection to the tool, and giving users a better default color
that will make the new strokes actually visible with the default
theme.
2018-07-09 19:42:37 +12:00
4a09bb1e8a Annotations: WIP access to tool settings in topbar
Lots of stuff to fix still - Not final UI at all
(in terms of widgets + properties exposed)

What works now:
* Exposed access to the setting controlling the default color to use
  when adding new layers
* Exposed access to change which color (layer) and thickness new strokes
  get drawn with (as per the current implementation). Now all annotation
  tools have tool settings exposed.

Big Todo's:
* Find a way to display color previews of GP Layers as icons
  (e.g. how to register all the necessary icon_id's, etc.)
* Replace the prop_search() with an enum prop
* Separate annotation RNA type defines? Context issues? etc.
2018-07-09 19:26:22 +12:00
6e05dc608c Annotation Eraser: Only operate on the active layer
Since we aren't exposing per-layer locks here (as we want to avoid
having lots of work enabling/disabling locks), the eraser now only
erases strokes on the active layer
2018-07-09 16:05:29 +12:00
3a53b24043 Cleanup: Assorted little tweaks/moving code around 2018-07-09 15:54:36 +12:00
2d2c03b8e4 Annotation Eraser Tweaks
* Remove the "soft" modes from the annotation eraser. Now, erasing
  strokes will immediately remove the stroke points. This works better
  for annotation use cases, as when erasing strokes, you usually just
  want to get rid of the notes quickly.

* Show eraser brush size setting in the topbar/tool settings when the
  eraser tool is active.  (Note: This setting still uses the userpref
  setting, which we should move to the scene toolsettings instead
  so that it doesn't get reset with each session)
2018-07-09 15:34:22 +12:00
7e6beb70ad Cleanup: Deduplicate stroke freeing code 2018-07-09 14:55:34 +12:00
85d61dfbd6 Merge branch 'blender2.8' into greasepencil-object 2018-07-09 14:32:40 +12:00
129c8fd684 Fix error when render
The v3d pointer is null when renders, so need to be checked before use it.
2018-07-08 20:43:09 +02:00
8fde165929 Fix errors and changes after merge 2018-07-08 16:45:16 +02:00
534c715bf5 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/drawgpencil.c
	source/blender/editors/gpencil/gpencil_brush.c
2018-07-08 16:17:35 +02:00
90a8ecc5ad Merge branch 'blender2.8' into greasepencil-object 2018-07-08 12:37:22 +02:00
646e90dee2 Move Vertex Opacity from Tolsettings to View3D
The vertex opacity is a parameter of the view and not of toolsettings as it was defined before.

With this commit we moved the last parameter to control the view look to the right place.
2018-07-08 12:36:39 +02:00
082b36934e Verify View3D is vailable before using it
This variable is not loaded when render.
2018-07-08 12:08:19 +02:00
4b84a25da9 Merge branch 'blender2.8' into greasepencil-object 2018-07-07 19:33:35 +02:00
82afe5c324 New Main switch at view level for Onion Skin
The switch is on top of GP datablock onion switch and allows to show/hide all datablocks in the view.
2018-07-07 19:17:27 +02:00
62526308ac Move Edit LInes and Multi Edit LInes switch at View level
This overlay must be by view, not by object.

Also changed the name to "gpencil_*" to some grease pencil paper to keep name consistency.
2018-07-07 18:30:07 +02:00
a8b63c3675 UI: Define a Header Text for Overlay Panel 2018-07-07 17:37:29 +02:00
9e7e926ed3 Try to fix the rim problem when the image ends outside view
The rim is disabled if the image to rim extends beyond the borders.
2018-07-07 11:13:01 +02:00
7ba438099b Improve Blur qualitty when the zoom factor changes
Now the number of pixels to blur depend of the pixel size and not as fix values as before.
2018-07-07 11:04:13 +02:00
fe68d0767f Fix animation path typo error
This error made impossible animate modifiers.
2018-07-07 10:51:21 +02:00
73cfbbcea9 UI: Reorganize Overlay panel
The separated panel for Paper and Options has been replaced by an unique panel, because two panels display too much empty space between them and make easier the maintenance.

Following how works other Blender panels, the paper options are hiddden when the paper is disabled, only required parameters are displayed.

We keep Onion switch here because is still pending the decission to use a general switch (mesh and GP) or keep separated switches.
2018-07-07 10:40:16 +02:00
5be3134ca0 Merge branch 'blender2.8' into greasepencil-object 2018-07-07 10:21:57 +02:00
158d55c2e6 UI: Move Vertex Opacity to Overlay 2018-07-07 10:21:26 +02:00
955a48384a UI: Small tweaks 2018-07-07 10:04:41 +02:00
924ff86814 Add Grease Pencil object to new View/Hide topbar control
Note: Used "GPencil" instead of "Grease Pencil" for Popup menu because full name is too long.
2018-07-06 22:55:47 +02:00
d809346eda Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/__init__.py
	source/blender/editors/object/object_add.c
	source/blender/editors/object/object_intern.h
	source/blender/editors/object/object_ops.c
	source/blender/editors/space_buttons/space_buttons.c
	source/blender/makesrna/intern/rna_internal.h
2018-07-06 22:31:03 +02:00
82a2bb2750 Enable Onion with Overlay button
The grease pencil onion skin need to set the cache as dirty to recalculate geometry, so a depsgraph recalc must be done when change Overlay switch.
2018-07-06 22:22:51 +02:00
55f01739c4 Undo hide Onion with overlay
There is a problem with the cache update and need a refactor. Remove the code while found a solution.
2018-07-06 20:54:48 +02:00
64abbdc192 UI: remove Edit Lines color from Overlay panel 2018-07-06 16:59:54 +02:00
2af322f3ba UI: Back Selected Mask options to Topbar
These options aren't overlays.
2018-07-06 16:55:16 +02:00
375dcdd5c4 UI: Add Edit LIne Color to Overlay 2018-07-06 16:41:00 +02:00
be13808886 Disable Onion y Edit lines with Overlay flag 2018-07-06 16:40:07 +02:00
8565fb5bce UI: Move some options to overlay (Edit lines, Onion) 2018-07-06 16:36:26 +02:00
ed5c6da73c Disable Grease Pencil Paper when disable overlays 2018-07-06 15:57:09 +02:00
974f2b6cfd U: Show grease pencil paper options in any GP mode 2018-07-06 15:37:43 +02:00
cf2a929bfe UI: Recover Pivot Point selector
After a merge, the pivot point disappear en Edit and Sculpt mode
2018-07-06 13:59:28 +02:00
4953892acf Check Weight data is available before duplicate or use
This is needed for using the functions in annotations where the weight data is not created
2018-07-06 11:06:32 +02:00
86f0549056 Merge branch 'blender2.8' into greasepencil-object 2018-07-06 10:23:54 +02:00
b5dfb62a2c Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/makesrna/intern/rna_gpencil.c
2018-07-06 09:30:22 +02:00
ca3cd8f916 New Shader FX implementation
This is the new implementation of the old VFX modifiers.

- All the BKE functions have been separated in new module and a new listbase was added to Object struct. Now the modifiers and the new shader FX are totally separated.

- Added a new section in properties panel for FX. ToDo: New Icon.

- Drawing methods improved aand new Rim and Colorize FX created.

Some functions and code (glsl and DRW_*) could be shared by other modules in the future, but as today only grease pencil is using it and the logic depend of the drawing engine, we decided to keep inside the GPencil drawing engine.
2018-07-06 08:46:00 +02:00
efc08aa600 Merge branch 'blender2.8' into greasepencil-object 2018-07-05 19:39:42 +02:00
2c19f296ce Fix: Icons for annotation tools now show in toolbar 2018-07-06 03:54:07 +12:00
4eefe33f77 Icons for Grease Pencil/Annotation tools
These were in the icon_geom.blend file in SVN (lib/resources),
but needed to be manually added to the Export group for this to
work.

They are needed for use for use with the annotation tools.

NOTE: There are currently problems running the icon generation
scripts in the gp-object branch due to some file loading pointer
remapping problems there causing segfaults when running the script.
Thus, I generated these icons using the 2.8 branch, then cherry-picked
that commit over to this branch.
2018-07-06 03:44:43 +12:00
b643f32354 Fixes for incorrect version patching code introduced in b6776304e7
* newlibadr() shouldn't be called from direct_link_* functions
  Besides, the pointers in question get corrected in
  lib_link_material() already

* Added expand_doit() calls for the sima and ima pointers.
  Following what's done for tex->ima, these also get expand_doit() calls,
  since they increase the usercount of images when used.
2018-07-06 00:38:33 +12:00
4b64b7e21c Cleanup: Remove the obsolete "ts->gp_brushes" field
This isn't used or accessed from anywhere anymore, so time to remove it
2018-07-06 00:38:32 +12:00
Nick Wu
68b0b7810e fix gcc warnings 2018-07-05 17:55:01 +08:00
41418be00d Merge branch 'blender2.8' into greasepencil-object 2018-07-05 09:49:23 +02:00
Nick Wu
ca4144a11a Provide a switch to turn on/off intersection line calculation to save time when intersection is not needed. 2018-07-05 15:25:07 +08:00
Nick Wu
ec2ccc7d60 software method preview now in correct aspect ratio 2018-07-05 14:53:01 +08:00
Nick Wu
9d71b50678 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-07-05 11:28:28 +08:00
Nick Wu
a75059cd44 fixed VC-specific warnings. 2018-07-05 11:17:36 +08:00
08b9036e3a Enable Grease Pencil paper in edit mode 2018-07-04 15:44:19 +02:00
8c45d279c9 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/object.c
2018-07-04 12:53:14 +02:00
b6776304e7 Fix missed materials after append GP object 2018-07-04 12:51:07 +02:00
Nick Wu
508a06e581 Merge branch 'soc-2018-npr' of git.blender.org:blender into soc-2018-npr
Conflicts:
	source/blender/draw/engines/lanpr/lanpr_engine.c
2018-07-04 17:38:13 +08:00
Nick Wu
42ddafedf5 debugging f12 weird behavior 2018-07-04 17:33:19 +08:00
Nick Wu
d5a1c5a4a0 debugging f12 2018-07-04 15:52:20 +08:00
ecb4a65460 Merge branch 'blender2.8' into greasepencil-object 2018-07-04 09:11:20 +02:00
Nick Wu
59d878aa5c Fixed multithread RenderTriangle size error 2018-07-04 13:32:40 +08:00
03082dd1dd Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/space_view3d.py
2018-07-03 19:46:29 +02:00
9d96302f47 Fix typo 2018-07-04 03:57:28 +12:00
891a944dfd Fix: Crash when erasing annotation strokes
The code was assuming that dvert data always exists on strokes
(it shouldn't, if we're doing everything correctly!), which
caused crashes when erasing annotation strokes (which definitely
don't have this data).

TODO:
Check that the rest of the code doesn't make similar assumptions!
2018-07-04 03:43:30 +12:00
cc7bbda849 Annotations: WIP first steps towards toolbar support
This adds a toolbar entry for activating the annotations tools
as active tools. Many things are WIP still (e.g. tool settings
are yet to come, as the necessary props aren't defined in DNA/RNA yet).

Todo's:
* Icons are missing.  The necessary icons *do* exist right now
  in the icon_geom.blend file, but I can't get them to export/generate
  .dat files that we can use in the UI here.  That said, the placeholder
  names (from that file) are now used.

* Key mappings need work/testing. They seem to work well enough as-is
  already though

* Tool settings (in topbar) are not implemented yet. Coming soon
  (aka tomorrow, after I get some sleep)

* Non-3D view toolbar support
2018-07-04 03:43:29 +12:00
179dfd0729 Cleanup: Remove 2D Editor support from gpencil_paint.c
The "GPENCIL_OT_draw" operator pretty much didn't support non-3D
views already (at least not without crashing). Now that we've got
a separate/dedicated operator for Annotation support (GPENCIL_OT_annotate),
we can remove the old 2D Editor support here.
2018-07-04 03:43:29 +12:00
c3f5c1dd20 Cleanup: Remove "Scene->gp_object"
This was from an earlier design for supporting Annotations,
where in the 3D view, we would have only had GP Objects.
Now that we've moved away from that idea, and are back to
having a separate "Annotations" system, this concept can
be removed from the code again.
2018-07-04 03:43:29 +12:00
6cb0327f17 Cleanup: Remove deprecated toolsettings->gpencil_src field
This was used to determine whether Grease Pencil data was stored
on the Scene level or per Object. It isn't actually used anywhere
in 2.8 now, with the GP Objects / Annotations. Removing now
to make space for storing the toolsettings for the annotation tools.
2018-07-04 03:43:28 +12:00
Nick Wu
74e029dcb6 Multithread OK. 2018-07-03 20:42:32 +08:00
Nick Wu
34db087c38 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-07-03 17:48:17 +08:00
Nick Wu
118cadf1ce move line layer and delete line layer component ok. 2018-07-03 17:43:35 +08:00
Nick Wu
54172dcab5 Line selection from object and collection is ok, material pending. 2018-07-03 16:28:39 +08:00
d86b7f53a8 Merge branch 'blender2.8' into greasepencil-object 2018-07-03 09:59:11 +02:00
339708d3eb GP UI: Make the "Grease Pencil Paper" panel/options part of the Overlays popover
This is a special feature only used during Draw Mode, and functionally
acts like an overlay. Some cleanups/tweaks to this are needed still,
but it's good to get it out of the way.
2018-07-03 17:15:37 +12:00
df1cf4af94 Cleanup: Variable Naming 2018-07-03 17:11:43 +12:00
ebbc047dfe Merge branch 'blender2.8' into greasepencil-object
# Conflicts:
#	release/scripts/startup/bl_ui/space_view3d.py
2018-07-03 13:20:38 +12:00
5abee2392f Fix for py errors in console, caused by bad poll callback for the "Animation" panel 2018-07-03 01:42:04 +12:00
9521de5583 Fix: Ensure correct names when using the "New Layer" operator for GP Object and Annotations
This replaces what 7931a1357a
tried to do.  We may still need to make these separate operators
to simplify things even further.
2018-07-03 01:42:03 +12:00
87a308ed33 GP Object: Don't show Add/Unlink datablock buttons for GP datablock ID selector
These buttons are not shown for any other object type,
so these shouldn't be shown for Grease Pencil objects.
2018-07-03 01:42:03 +12:00
105c0d178a Revert "Add annotation layer with the right name"
This reverts commit 7931a1357a.
2018-07-03 01:42:03 +12:00
bd53e9f2c5 Remove Animdata update for Palettes
This datablock is not animatable.
2018-07-02 13:24:16 +02:00
cb32dd9604 Fix parameter type after merge 2018-07-02 13:03:20 +02:00
fa73cd1854 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_data.c
	source/blender/editors/gpencil/gpencil_edit.c
	source/blender/editors/gpencil/gpencil_intern.h
	source/blender/editors/gpencil/gpencil_utils.c
	source/blender/makesrna/intern/rna_internal.h
2018-07-02 12:48:37 +02:00
Nick Wu
07b7fae45d Updated ui, more easy to be used. (take advantage of new grouping api) 2018-07-02 17:11:00 +08:00
Nick Wu
f5b133fc2a Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-07-02 11:46:00 +08:00
6728b4a9b0 Cleanup: trailing space 2018-07-01 19:12:52 +02:00
31fee9b670 Merge branch '28' into greasepencil-object 2018-07-01 19:10:19 +02:00
531f833491 Cleanup: unused vars & comment block that doesn't run 2018-07-01 19:09:21 +02:00
014395cb53 Rename variable after merge 2018-07-01 11:09:59 +02:00
a1f0aed7d8 Merge branch 'blender2.8' into greasepencil-object 2018-07-01 11:01:04 +02:00
7931a1357a Add annotation layer with the right name
When adding layers, the name of the layer is different for grease pencil object and annotation.
2018-07-01 11:00:29 +02:00
552b954d30 Merge branch 'blender2.8' into greasepencil-object 2018-06-30 19:38:35 +02:00
02f4a180d9 Merge branch 'blender2.8' into greasepencil-object 2018-06-30 09:00:21 +02:00
cb144fe5ce Merge branch 'blender2.8' into greasepencil-object 2018-06-29 20:41:57 +02:00
1b13fdaf80 Annotations: Restore 3D View support for annotations (WIP)
Initial support for getting annotations to show up in the 3D
viewport again.  WIP and slightly hacky, but it restores basic
working functionality so we can focus on polishing the "new" parts.

Ultimately, the way these callbacks are integrated into the
drawing loop will probably need to change. For example,
* Perhaps we might need a full overlay engine for this one case
  (as for motionpaths), though that may also be overkill, and would
  further split the code in different places.
* The draw order (relative to manipulators) needs review. It probably
  should be below both sets of manipulators, not sandwiched between them.

Other notes:
* For this to work, we currently need to use the original (non-evaluated)
  scene data, or else we don't get the newly drawn strokes, as the
  scene->gpd stuff isn't copied by COW yet.
2018-06-30 02:52:20 +12:00
e2626831dc Annotations Keymap: Restore D-RMB for eraser 2018-06-30 02:52:20 +12:00
8308a051b4 Cleanup: Remove redundant code + note some code issues to fix 2018-06-30 02:52:19 +12:00
bc0f489619 Set annotions drawing mode always on top
The annotations must be visible on top of any other object in the scene.
2018-06-29 12:51:07 +02:00
Nick Wu
d4c5c2d76b Offline, DPIX, Snake working. no F12. DPIX draw intersection if cached. 2018-06-29 17:53:45 +08:00
ebadf391e3 Fix render type name error 2018-06-29 11:04:43 +02:00
0dbbedbf0f Cleanup code 2018-06-29 10:58:17 +02:00
0c1c619681 Fix draw back error due z-depth precission
The value 1.0 makes the image disappear.
2018-06-29 10:13:50 +02:00
f88f2b73c0 Merge branch 'blender2.8' into greasepencil-object 2018-06-29 09:55:11 +02:00
3587e5ca1e Fix problem when increase viewport qualitty
The reason of the problem was the precission of the background buffer. The original value was not enough when viewport qualitty was > 0.1
2018-06-29 09:52:30 +02:00
2784f1b6fc Cleanup unused extern definition
This was part of old VFX modifiers.
2018-06-29 09:43:34 +02:00
6ece125739 Fix again the pointer name for textures 2018-06-29 09:42:43 +02:00
Nick Wu
3ea9277205 removed line styles from SceneLANPR 2018-06-29 14:18:11 +08:00
Nick Wu
02b3e81793 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-06-29 12:03:27 +08:00
Nick Wu
141c2cf150 Multisample implementing, f 12 won't work either. 2018-06-29 12:01:12 +08:00
f19b34b43b UI: Rename Grease Pencil Simplify Panel 2018-06-28 17:45:56 +02:00
824ef929f6 Fix merge errors 2018-06-28 17:44:59 +02:00
823bb18425 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/datafiles/userdef/userdef_default_theme.c
	release/scripts/startup/bl_ui/properties_scene.py
	source/blender/editors/gpencil/drawgpencil.c
	source/blender/editors/gpencil/gpencil_brush.c
	source/blender/editors/gpencil/gpencil_paint.c
2018-06-28 17:33:55 +02:00
23ffb562b6 Move GPD runtime fields to runtime struct 2018-06-28 17:25:30 +02:00
Nick Wu
0065c907c4 remove linear depth conversion. now clipping finally works as expected. 2018-06-28 22:55:39 +08:00
e97f357b19 Annotations: Set better default name for new annotation layers
Note: Many of the add layer operators still need tweaks,
but this is a good start for the main ones.
2018-06-29 02:48:27 +12:00
8869939d58 Annotations: Restore color selector per layer
This shows up in the layer list, making it possible to quickly change it
inline, and to see what color the strokes in the layer are using.
2018-06-29 02:29:41 +12:00
630d1ac6fc GP/Annotations: Provide usage hints about the "Poly" tool 2018-06-28 21:32:51 +12:00
bfae260928 Annotations: Don't respect the "on back" option
This is too complicated for an annotation tool
2018-06-28 21:27:41 +12:00
91f7ba14f2 Remove "Continuous Drawing" flag/mode
* GP Object doesn't need this as it has a proper "Draw Mode"

* For Annotations, it just got in the way and was a confusing
  modal+blocking nuissance that randomly activates when you just
  want to draw a quick line
2018-06-28 21:25:49 +12:00
bec3a00e59 Annotations Fix: "Freehand" mode now works
Was over-zealous when removing code from the drawing operator
to remove all the non-essential additions here.

Now annotations work in some of the 2D views:
* Nodes/Image Editor are confirmed to work
* Sequencer Preview needs further work
* Movie Clip editor works
2018-06-28 21:15:31 +12:00
3de40395da Fix stabilizer cursor after annotations
The cursor was drawn to wrong position after use annotations.
2018-06-28 10:19:26 +02:00
894b3b1f4e Annotations: Put in place basic building blocks for Annoations UI (WIP)
This is still a rough draft, just restoring all the essential bits and
pieces to have a workable system.
2018-06-28 19:13:20 +12:00
398ce6d987 Cleanup: Change "Drawing Tools" panel to use the annotation tools, not old GP drawing operator
This panel is going away soon, to be replaced by the active tools system.
But in the meantime, we need to stop using this old panel as it will
cause crashes when used.
2018-06-28 19:13:20 +12:00
76f914d36c Fix: Errors in console when using annotations in viewport
Was caused by a missing poll callback for a GP object panel
2018-06-28 19:13:20 +12:00
f1470f8a20 Cleanup: Move GP-Object specific UI panels to the appropriate file 2018-06-28 19:13:20 +12:00
979a881e23 Cleanup: Remove unused stuff 2018-06-28 19:13:20 +12:00
6b42183120 3D Annotations: Restore ability to access annotations from the 3D view
For now, the "gpencil" context properties work as follows:
* If the active object is a GP Object, the GP data associated with
  that is returned
* Otherwise, the Scene's GP data (i.e. annotations) are used

We may need to revise this later. But in the meantime, I'm restoring
this so that we have a quick way of figuring out what parts of the
annotation tool workflow are currently broken.
2018-06-28 19:13:18 +12:00
f855bb52fb Annotations: Properly initialise annotation datablocks 2018-06-28 19:13:17 +12:00
560950776e TODO: Note some struct members that should be moved to runtime data struct 2018-06-28 19:13:17 +12:00
4726aa3d5e Annotations: Repurpose an ancient/rarely-used flag to indicate that a GP datablock is used for annotations 2018-06-28 19:13:16 +12:00
6df2bed1e9 Annotations: First steps towards having working annotations again
Copy-back (from 2.8) and split out "Annotations" drawing operator/rendering
code from the "GP Object" versions of the same code.

Notes:
* All "annotation" related things are now in the annotate_*.c files,
  while "drawgpencil.c" and "gpencil_paint.c" are for the GP Object only
  now. This will simplify maintenance of the two different usecases,
  as the GP Object versions are significantly more complicated and filled
  with extra cruft.

* The general "Grease Pencil" keymap (i.e. the one that allows DKEY+LMB-drag
  to draw) is now for annotation usage only. For GP Objects, you can add a
  blank GP Object, enter Draw Mode, and start drawing.

Code Changes:
* Removed all 2D drawing-code entrypoints from drawgpencil.c

* Cleaned up most of the annotate_paint.c and annotate_draw.c code
  to remove stuff that annotations won't use (e.g. brushes, palettes,
  fancy line effects, etc.)  As much as possible, these have been restored
  back to a pre 2.77 state - with the notable exception of per-layer
  Onion Skinning, for which the settings were removed already.
2018-06-28 19:13:16 +12:00
f3c42200d3 Cleanup: Remove all mention of annotations from GP drawing operator 2018-06-28 19:13:16 +12:00
57ef71c555 Cleanup: Move comments to sit above the right structs 2018-06-28 19:13:16 +12:00
b41d293a96 Set again mix pass to DEPTH_LESS
Using ALWAYS for this pass is wrong because when using several objects, only the less z-depth object is drawn.
2018-06-28 09:12:35 +02:00
Nick Wu
b6129384d7 Modified triangulator function 2018-06-28 13:46:07 +08:00
Nick Wu
a63777b879 Fixed normal matrix error. obmat needs double to produce better result. 2018-06-28 12:30:58 +08:00
Nick Wu
40b2263284 Fixed save/reading error on line style thing... 2018-06-28 09:31:18 +08:00
Nick Wu
84877dc53f Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
Conflicts:
	release/scripts/startup/bl_ui/properties_scene.py
2018-06-28 08:46:30 +08:00
b3ec99f176 Revert "Fix wrong engine name"
This reverts commit 7c3c256170.
2018-06-27 22:44:13 +02:00
8b1315facd Temp fix to compile
There is a problem with the generator for themes, and this is a temp fix while Campbell fix the generator,
2018-06-27 20:15:49 +02:00
b0ba7341bd Merge branch 'blender2.8' into greasepencil-object 2018-06-27 16:51:39 +02:00
411a8d13e9 Increase multisample texture precission
When use FX get glitches.
2018-06-27 16:45:04 +02:00
7c3c256170 Fix wrong engine name 2018-06-27 16:44:23 +02:00
01d9f8131e Merge branch 'blender2.8' into greasepencil-object 2018-06-27 11:43:20 +02:00
c11748475a Fix struct typo name errors 2018-06-27 11:33:48 +02:00
08a2176558 Fix FXAA problem when drawing
The internal passes never must check z-depth values, only in the final pass.
2018-06-27 11:28:11 +02:00
c6b1a931a3 Compile fixes after merge 2018-06-27 18:40:11 +12:00
3b34bc96ca Merge branch 'blender2.8' into greasepencil-object
# Conflicts:
#	source/blender/editors/gpencil/gpencil_interpolate.c
#	source/blender/editors/gpencil/gpencil_paint.c
2018-06-27 18:25:38 +12:00
Nick Wu
3a4515add9 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-06-27 11:12:43 +08:00
3bbf08cc15 Cleanup: Remove some obsolete defines 2018-06-27 00:03:15 +12:00
Nick Wu
4970b003ed Offline render running and display is ok. Don't render more than 1 time. 2018-06-26 18:31:10 +08:00
7caccf4bf2 Merge branch 'blender2.8' into greasepencil-object 2018-06-26 21:48:41 +12:00
Nick Wu
fd2036333b redo-ing draw code for offline rendering 2018-06-26 14:03:52 +08:00
Nick Wu
309f06c4ef rename LANPR_LineStyle into LANPR_LineLayer. 2018-06-26 09:29:40 +08:00
66b1de59b5 Merge branch 'blender2.8' into greasepencil-object 2018-06-25 22:30:25 +02:00
Nick Wu
e6821d3d27 Drawing code moved in, but most parts need redo. 2018-06-25 21:37:17 +08:00
f99830961a Merge branch 'blender2.8' into greasepencil-object 2018-06-25 11:04:48 +02:00
53447101f6 Merge branch 'blender2.8' into greasepencil-object 2018-06-25 09:21:00 +02:00
Nick Wu
1a8652192e Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-06-25 13:48:30 +08:00
b8cb4b5e01 UI: Hide layer panel if not GP object 2018-06-23 22:29:05 +02:00
af5f4f5d74 Merge branch 'blender2.8' into greasepencil-object 2018-06-23 22:02:25 +02:00
7d954885ff Fix z-depth error drawing new strokes
The new strokes must be on top of any other stroke.
2018-06-23 18:42:58 +02:00
4c58ab8754 Merge branch 'blender2.8' into greasepencil-object 2018-06-23 16:44:07 +02:00
67faa2d34d Fix missing thickness when scale or mirror
The line was reset to minimum thickness when it was scale with -1 or the mirror transform was used.
2018-06-23 16:28:41 +02:00
5eb25b1856 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/makesdna/DNA_scene_types.h
	source/blender/makesrna/intern/rna_scene.c
2018-06-22 22:54:07 +02:00
a10266310b UI: Changes in Specials and Deleet menus 2018-06-22 18:14:20 +02:00
b7bdae5304 Adapt code after merge 2018-06-22 16:53:50 +02:00
85674e73b0 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/space_outliner/outliner_draw.c
	source/blender/makesdna/DNA_modifier_types.h
	source/blender/makesdna/DNA_object_types.h
2018-06-22 16:42:41 +02:00
018f2724f8 Fix segment fault in Noise Modifier
The random init seed was not done in the right function.
2018-06-22 16:09:33 +02:00
Nick Wu
0fb1e8fb03 Uncrustify processed. 2018-06-22 17:34:09 +08:00
Nick Wu
45a2126cc1 Offline intersection and occlusion test code complete. 2018-06-22 16:55:05 +08:00
Dalai Felinto
2ec28dd28f Fix reading modifier object pointers
Kudos to Bastien Montagne to help figure out the special modifier read code.
2018-06-22 10:15:09 +02:00
Dalai Felinto
71e2a5a56f Remove unused variable
(instead of poorly silencing it with UNSED =))
2018-06-22 09:08:54 +02:00
Dalai Felinto
161c67de14 Merge remote-tracking branch 'origin/blender2.8' into greasepencil-object 2018-06-22 09:05:39 +02:00
Dalai Felinto
727f6d70fa Silence warning + cleanup 2018-06-22 09:05:27 +02:00
Nick Wu
d234d87295 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-06-22 13:31:25 +08:00
009f33b588 Fix name typo error 2018-06-21 17:23:29 +02:00
82ecee0a7b Small UI Fixes
* Fixed comment about the "Surface" panel. It's used after all
  (as a parent for two others). Adjusted comment to make that
  more obvious.

* Don't show decorators on the Parent Relations panel.
  None of those settings should be driven/animated.
  Maybe we put it back for overrides later though?
2018-06-22 02:18:47 +12:00
6d85d0f08a Cleanup: Delete unused code 2018-06-22 02:18:47 +12:00
8e4b87e9a5 Cleanup: Move some GP Object specific types to their respective files 2018-06-22 02:18:47 +12:00
788a6d078e Merge branch 'blender2.8' into greasepencil-object 2018-06-21 16:14:26 +02:00
36ce57f306 Merge branch 'blender2.8' into greasepencil-object 2018-06-21 15:50:31 +02:00
Nick Wu
801d037802 Render process ok. spin lock ok. DON'T COMPILE 2018-06-21 21:27:36 +08:00
7f6ec8c7fe Cleanup: Remove a few more references missed earlier 2018-06-21 23:25:34 +12:00
c719299bf2 Cleanup: Remove all old panels that Annotations will not be using 2018-06-21 23:14:21 +12:00
3012ea067f Remove various checks used in the general GP layers/data panel for isolation the GP Object 2018-06-21 22:57:59 +12:00
6e9b328a39 UI Tweak: Disable property split for GP Layers panel
There's just a single property here (opacity) under a
list widget that spans the full width of the panel.
It's not really worth having the half-size widget here.
2018-06-21 22:53:02 +12:00
71dd90c5c9 Decouple GP Object's "Layers" panel from that used for "Annotations" 2018-06-21 22:44:28 +12:00
208bf89fd2 UI: Simplify Panel default closed 2018-06-21 11:09:27 +02:00
d757771d27 Add depsgraph support for gpencil_modifiers_foreachTexLink 2018-06-21 10:58:45 +02:00
e584443af7 More depsgraph missing: modifiers_foreachIDLink 2018-06-21 10:39:39 +02:00
Nick Wu
de60a9646a Continue modifying files. Don't compile! 2018-06-21 16:36:01 +08:00
382db124d1 Changes to integrate depsgraph evaluation for modifiers
Still pending:

- void DepsgraphNodeBuilder::build_object
- void DepsgraphRelationBuilder::build_object
2018-06-21 10:33:50 +02:00
35d823c3e4 Merge branch 'blender2.8' into greasepencil-object 2018-06-21 10:07:08 +02:00
853da3babc New functions for ID Linking 2018-06-21 10:04:55 +02:00
Nick Wu
57d52826f6 Added almost all offline render code. adaptation pending, don't compile! 2018-06-21 15:56:49 +08:00
Nick Wu
7d062aabac turn off freestyle. preserve edge mark ops to to edit older files. 2018-06-21 11:12:21 +08:00
Nick Wu
c20e6ee66f UI fixed. active_layer is working now 2018-06-21 10:44:21 +08:00
ae8620b3ae Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/space_view3d.py
2018-06-20 19:26:07 +02:00
f23e999720 Cleanup: Rename shader to keep name consistency 2018-06-20 19:12:41 +02:00
67c7b58313 UI: Second round to fix panel
I made stupids errors in previous commit
2018-06-20 18:54:48 +02:00
06cff7dd8e Cleanup: Stupid duplicated line 2018-06-20 18:50:51 +02:00
b4284a99bf UI: Back proportional editing for Sculpt mode 2018-06-20 18:48:13 +02:00
Dalai Felinto
39c9d9035f Rename greasepencil callbacks since we are already in GP namespace 2018-06-20 18:40:18 +02:00
Dalai Felinto
a624e1b5ff Silence warning 2018-06-20 18:38:46 +02:00
Dalai Felinto
8703dafb51 Fix crash on tweaking greasepencil modifier
We were missing a proper copy of modifiers.

Note: there was a warning for the function not being declared in any header
it should be enough to find the error by following the warning.
2018-06-20 18:34:03 +02:00
6d4ee22da2 WIP: Free modifiers memory
This was missing, but this lines get a segment fault

Still memory leak present
2018-06-20 17:42:03 +02:00
b5247238bb Split Grease Pencil Stack modifiers
Now all modifiers logic is totally separated of mesh modifiers.

Thanks Dalai Felinto for his help and support doing this change.
2018-06-20 17:20:08 +02:00
6b1e6b2061 Cleanup: Rename fields 2018-06-20 17:08:46 +02:00
Nick Wu
5f08c4e819 implemented set() for active_layer but still. 2018-06-20 22:37:10 +08:00
83f5606b69 Fix random number functions after merge 2018-06-20 16:00:14 +02:00
Nick Wu
eaf9f696f5 lanpr.layers.active_layer always return None. weird. 2018-06-20 21:48:22 +08:00
7f1eddb5ab Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenlib/BLI_rand.h
	source/blender/blenlib/intern/rand.c
	source/blender/makesrna/intern/rna_gpencil.c
2018-06-20 14:30:08 +02:00
2f9b8c7bc6 Fix multisample textures were using default not local copies
The multisamples used were not the custom textures for GP.
2018-06-20 11:05:18 +02:00
Dalai Felinto
e9b91d5803 Fix lanpr DNA not compiled 2018-06-20 10:24:23 +02:00
Nick Wu
ae2d58f443 Adding LANPR structures. makesrna fails, very weird. 2018-06-20 15:59:26 +08:00
b281b0fb6c Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/space_outliner/outliner_draw.c
2018-06-20 09:43:55 +02:00
747c2814b0 Clenaup: Rename pass 2018-06-20 08:26:31 +02:00
eb3d80e6b8 Update depsgraph after adding Monkey 2018-06-19 17:19:21 +02:00
f0749f9f17 Merge branch 'blender2.8' into greasepencil-object 2018-06-19 17:07:14 +02:00
86dd04d540 UI: More panel adjustments 2018-06-19 17:06:04 +02:00
fe9e3ff97f Fix memory leak for RNG
After last changes in random number generation, there was a memory leak.
2018-06-19 16:58:11 +02:00
f195fc73b0 UI: Fix align in weight paint panel 2018-06-19 16:19:13 +02:00
e631871461 UI: Hide decorator icons
This icons break the design of the panel
2018-06-19 16:16:16 +02:00
b6fabaa83f UI: Set opacity parameter to single column layout 2018-06-19 15:52:29 +02:00
94c94e7a63 Merge branch 'blender2.8' into greasepencil-object 2018-06-19 11:21:50 +02:00
Nick Wu
2a7b4a84af Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-06-19 11:32:44 +08:00
Nick Wu
48e17cea96 Adding software render functions. don't compile! 2018-06-19 11:27:53 +08:00
967718b206 Merge branch 'blender2.8' into greasepencil-object 2018-06-18 17:45:22 +02:00
865f5ac173 Fix whitespace error breaking UI 2018-06-19 01:14:23 +12:00
556f23ab50 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/space_userpref.py
2018-06-18 11:08:16 +02:00
f0efa634b2 Git submodules
This commit was generated by Visual Studio
2018-06-18 10:50:53 +02:00
6782bdcc11 Hide internal properties in the viewport 2018-06-18 09:57:19 +02:00
15a58ebc31 UI: Expand direction buttons
This was disabled due layout bug
2018-06-18 08:35:17 +02:00
2a89323947 Merge branch 'blender2.8' into greasepencil-object 2018-06-18 08:24:07 +02:00
Nick Wu
c561923617 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
Conflicts:
	source/tools
2018-06-18 10:22:20 +08:00
a0c8cf8f36 Make properties not animatable
These properties must not use the icon to animate property.
2018-06-17 20:14:25 +02:00
8eeb857cab Fix merge error in Topbar
This errors broke the topbar
2018-06-17 19:43:57 +02:00
f1daff28a0 Merge branch 'blender2.8' into greasepencil-object 2018-06-17 17:12:26 +02:00
67747dc2c3 Merge branch 'blender2.8' into greasepencil-object 2018-06-17 16:57:51 +02:00
687d248486 UI: Changes in sculpt brush panel
* The direction is not expanded because enabling Expand=True rises an Assert.
2018-06-17 16:24:01 +02:00
0883e0c51d Add default icons for direction 2018-06-17 16:18:24 +02:00
1cf1ff17e0 Merge branch 'blender2.8' into greasepencil-object 2018-06-17 12:55:55 +02:00
1902d38ec9 Fix changes after merge 2018-06-16 19:51:56 +02:00
747d1a8989 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_brush.c
        source/blender/editors/gpencil/gpencil_intern.h
	source/blender/editors/gpencil/gpencil_paint.c
	source/blender/editors/gpencil/gpencil_utils.c
2018-06-16 19:39:59 +02:00
08a2bde685 Modify copy function after merge 2018-06-16 10:17:02 +02:00
9ad04b85ef Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/gpencil.c
2018-06-16 10:01:21 +02:00
Nick Wu
0944c31451 render_to_image implemented, but not working correctly. 2018-06-15 22:03:19 +08:00
64599aff4c UI: Move Draw on Back to Topbar 2018-06-15 10:31:08 +02:00
205cd86516 UI: Chnages in Sculpt Brush panel 2018-06-15 10:18:01 +02:00
c98b4ee52d UI: Cleanup Appearance panel 2018-06-15 09:52:54 +02:00
cabd84f4a2 UI: Move more Brush option panels as Subpanels 2018-06-15 09:48:36 +02:00
240a78377a UI: Move Brush Stabilizer to Subpanel 2018-06-15 09:35:48 +02:00
0e2e8381b8 Merge branch 'blender2.8' into greasepencil-object 2018-06-15 09:23:38 +02:00
10d948469c UI: Some cleanup of properties panels (WIP) 2018-06-14 20:14:33 +02:00
4bad42176b Check the context outside tool system
for grease pencil we don't use tool system yet, so we need check outside  workspace->tools_space_type because this value is not available.

Thanks Campbell Barton for his help fixing this bug.
2018-06-14 19:50:56 +02:00
d7439790d3 Cleanup: unused vars 2018-06-14 19:44:34 +02:00
39b0ac43cc UI: MOve topbar panels to Properties
WIP: Still some issues pending.
2018-06-14 19:30:46 +02:00
b468f18e86 Cleanup: Missing in previous commit 2018-06-14 18:46:55 +02:00
35c7876606 Cleanup: Remove unused parameter 2018-06-14 18:45:42 +02:00
484d44ccc4 Add missing context to buttons_main_region_layout_too() 2018-06-14 18:41:57 +02:00
Dalai Felinto
22ed3aa70b Fix building error, silence warning, stop double promotion 2018-06-14 18:28:53 +02:00
1f80f84d17 Cleanup: Remove excessive space 2018-06-14 17:36:16 +02:00
82edf15fd3 Merge branch 'blender2.8' into greasepencil-object 2018-06-14 16:16:35 +02:00
decc0f661a UI: Get back Pivot point origin
This control was removed by error in previous merges.

This change is temporary while the topbar is redesigned.
2018-06-14 16:13:48 +02:00
38aadd9a71 Merge branch 'blender2.8' into greasepencil-object 2018-06-14 09:52:06 +02:00
Nick Wu
62e4fb9113 Added DPIX crease fading. 2018-06-14 11:57:27 +08:00
Nick Wu
74ca16c418 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-06-14 09:50:06 +08:00
bebe6ce3ef Merge branch 'blender2.8' into greasepencil-object 2018-06-13 19:54:54 +02:00
9556e434b6 Fix errors after merge 2018-06-13 16:38:23 +02:00
401cdb36f8 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/space_view3d.py
	source/blender/blenkernel/intern/gpencil.c
	source/blender/editors/gpencil/gpencil_data.c
	source/blender/editors/gpencil/gpencil_paint.c
	source/blender/editors/space_view3d/view3d_manipulator_ruler.c
	source/blender/editors/space_view3d/view3d_ruler.c
	source/blender/makesrna/intern/rna_main_api.c
2018-06-13 16:27:34 +02:00
29bf8d456e Cleanup: More style changes 2018-06-13 16:18:12 +02:00
7053b00083 Cleanup: Remove unused struct
These lines were used by old palette system.
2018-06-13 16:07:15 +02:00
1ba5910098 Cleanup: Create macros for duplicate code 2018-06-13 16:04:13 +02:00
d1260a0820 Cleanup: Rename variables and comments 2018-06-13 15:49:02 +02:00
Nick Wu
813aea9b23 Now with seperate line thickness factor. 2018-06-13 21:18:37 +08:00
Nick Wu
9bc49a7c88 Seperate color demonstration. 2018-06-13 20:39:03 +08:00
Nick Wu
727104839d Added support for Freestyle edge mark. 2018-06-13 17:54:04 +08:00
Nick Wu
2076721e71 Seam and Material lines can be ena/disabled in dpix. Also added UI. 2018-06-13 17:27:17 +08:00
fa4100950d UI: Hack topbar to keep all running while found final design
These changes are only to keep running grease pencil with the last merge.

All these UI elements must be relocated to the right place, but if we don't show them in the UI while we get the final place, the grease pencil is unusable.
2018-06-13 10:35:32 +02:00
84d2d4e75e Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/space_topbar.py
2018-06-13 08:40:46 +02:00
Nick Wu
625de6ef81 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-06-13 14:25:14 +08:00
7b2c840314 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenlib/intern/rand.c
2018-06-12 18:43:26 +02:00
1e611c1ce0 Remove Draw at Stroke Location
This option at layer level was only for very limited situations and added complexity not needed.
2018-06-12 17:11:08 +02:00
37ffbb292d Rename field gradient_boxsize to pattern_gridsize 2018-06-12 16:24:05 +02:00
bebc6bfee6 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/datafiles/CMakeLists.txt
	source/blender/makesdna/DNA_material_types.h
2018-06-12 15:46:08 +02:00
dc422dcdbf PEP8 Style 2018-06-13 01:40:28 +12:00
795a266697 Added missing "Custom Properties" panel for GP Objects 2018-06-13 01:40:28 +12:00
7d0ad0d441 UI: Check if the material has gpencil data to show panel 2018-06-12 15:38:45 +02:00
ce5ecd19b3 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/include/ED_object.h
	source/blender/editors/object/object_modifier.c
2018-06-12 13:56:46 +02:00
3721b857c6 GP Branch: Update gpl->actframe in depsgraph callbacks (fixes COW-related issues)
This commit fixes various problems across the codebase
caused by the fact that the gpl->actframe pointers no longer
get updated on redraw, meaning that various editing tools
were not working.

Applying a similar solution to 59a516913e
here: On the exit node for GP data evaluation, we flush the changed
actframe pointers back to main database, so that the main db
is consistent with the displayed time.

Notes:
- For now, we just reuse the BKE_gpencil_eval_geometry() callback,
  since it's the only one there and nothing else was happening there.
  In future, when we do convert the GP modifier stack evaluation away
  from its drawing-engine based approach, we should split this out into
  its own function.

- We also do the actframe update in the COW domain here. While it's
  not strictly needed for anything right now, this is something that
  should really have been happening, so let's do it the proper way now.

- The alternative approach would've been to modify all GP related
  context functions to set this whenever they were called. But that
  carries performance penalties, and isn't such a nice solution,
  as context getters should really not have side-effects.
2018-06-12 23:39:25 +12:00
d69ac37f85 Fixes after merge
Some parameter list change.

Also disabled some functions that will not be used in annotations. Keep the function as reference to be removed when annotation will be back.
2018-06-12 12:49:15 +02:00
e9964ed175 Merge branch 'blender2.8' into greasepencil-object 2018-06-12 12:40:39 +02:00
d3f35b58da Add comments to review context creation in render 2018-06-11 17:55:15 +02:00
3bacfa08f9 Add missing parameter after merge 2018-06-11 17:54:32 +02:00
d296a846c6 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/space_view3d.py
2018-06-11 17:41:11 +02:00
e00948e9e8 Fix errors after merge 2018-06-11 16:00:58 +02:00
7dbdd96912 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/object_update.c
2018-06-11 15:51:02 +02:00
Nick Wu
d3ba4b3535 depth behave weird, fixed multisample on snake result. 2018-06-11 18:22:39 +08:00
3faa0e6c54 Fix segment fault in weight paint for 2.8 old files
This code would be moved to versioning code after merge, but now it's required to manage files created with previous versions of 2.8 (not 2.7x)
2018-06-11 11:38:27 +02:00
e98b9d3c9c Remove mode switching custom code
This code is not required because the mode switching is not done with keys 1..9
2018-06-11 11:27:14 +02:00
Nick Wu
4a63d0c9f0 added depth-alpha line style control (pre multiply) 2018-06-11 15:02:27 +08:00
67cfa736b4 Merge branch 'blender2.8' into greasepencil-object 2018-06-11 08:55:55 +02:00
Nick Wu
d64862f778 Add: depth controlled line width. 2018-06-11 14:02:36 +08:00
Nick Wu
711c3f504e Added multisampe support functions in DRW. transform_to_screen later. 2018-06-11 10:38:23 +08:00
Nick Wu
28823638f1 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
Conflicts:
	source/tools
2018-06-11 09:54:18 +08:00
98021bd7d1 Move multisample textures to texture list
If the texture is in e_data is shared for all viewports and fails.
2018-06-10 20:56:56 +02:00
63dcb04a71 Cleanup GP multisample code 2018-06-10 20:18:53 +02:00
952d9559d2 Merge branch 'blender2.8' into greasepencil-object 2018-06-10 16:47:02 +02:00
e6995bb77f Merge branch 'blender2.8' into greasepencil-object 2018-06-10 10:47:42 +02:00
3b94a96fa1 Merge branch 'blender2.8' into greasepencil-object 2018-06-09 19:49:47 +02:00
e51e9bda6f Merge branch 'blender2.8' into greasepencil-object 2018-06-09 16:07:52 +02:00
ea7740addc Cleanup: Remove unused line 2018-06-09 13:37:13 +02:00
827b7de9d6 Add a new User Prefs parameter to control GP multisample AA
For general use of Viewport the multisample AA is not required and can produce errors in selection, but for grease pencil the AA is required all the time to get smooth lines, so a new parameter has been added to User Prefs screen to define this value.

If we use the same value for both AA (grease pencil and Viewport), the viewport would be intefered by grease pencil settings.

The new value is below Viewport Samples.

By default the value was set to 4 samples.

This changes was done as result of requirement of grease pencil development team artists.
2018-06-09 13:30:36 +02:00
1c85a74c44 WIP: Add parameter to multisample 2018-06-09 13:30:36 +02:00
6816582b5a Merge branch 'blender2.8' into greasepencil-object 2018-06-09 09:29:06 +02:00
71dc55e3bb Fix errors after merge 2018-06-08 18:02:51 +02:00
1beeff419e Merge branch 'blender2.8' into greasepencil-object
source/blender/editors/gpencil/gpencil_edit.c
	source/blender/editors/gpencil/gpencil_paint.c
	source/blender/editors/gpencil/gpencil_utils.c
	source/blender/editors/space_view3d/view3d_ruler.c
2018-06-08 17:50:59 +02:00
b76343410b Changes in Fill tool
There were some problems with the mouse position and the new TopBar.

Some changes done in order to avoid get_pixel error, but I could not reproduce the crash in Windows.
2018-06-08 16:45:15 +02:00
42e6b9217f Merge branch 'blender2.8' into greasepencil-object 2018-06-08 10:58:21 +02:00
ad5196b075 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/space_view3d.py
	source/blender/editors/object/object_ops.c
2018-06-08 09:55:29 +02:00
7afa353d5e Redo stats calculation
Now the stat info is saved in the datablock to avoid recalculations and the stats are calculated in one function.

Still pending move the update of the stats to a better place to calculate only when the object change, maybe in depsgraph evaluation.
2018-06-08 09:44:19 +02:00
7b4fc58a2a Fix macro argument use 2018-06-08 08:23:46 +02:00
4846f644a9 Merge branch 'blender2.8' into greasepencil-object 2018-06-07 19:24:26 +02:00
3b5d9ce441 Move Info panel to Bottom Bar Statistics
Now the info appears in the same place that other object types.
2018-06-07 19:15:12 +02:00
9e1bdca3ba Merge branch 'blender2.8' into greasepencil-object 2018-06-07 18:00:21 +02:00
2882430d37 Reorganize Mix Color with Texture
Now, the mis is only with texture to avoid duplicate texture parameters that made the panel difficult to understand.
2018-06-07 17:51:12 +02:00
e5615c7835 UI: Include Stroke and Fill as subpanels of Surface Panel. 2018-06-07 17:39:21 +02:00
1f388a2188 UI: Move Pass Index to separate Panel 2018-06-07 17:23:03 +02:00
816d9beec2 UI: More changes in Viewport Display Panel 2018-06-07 16:47:03 +02:00
68a9bb0268 UI: Replace label to "Stroke Thickness" 2018-06-07 16:43:49 +02:00
aafeefe927 UI: Rename label "Use in Render" to "View In Render" 2018-06-07 16:42:13 +02:00
61b69af84f Remove unused Layer Onion Skinning fields
These fileds are not used because the Layer override was removed in a previous commit.
2018-06-07 16:39:59 +02:00
bd2c4ba698 Disable Onion Skinning for old Drawing methods
This code will be used for annotations and is not requiered.
2018-06-07 16:25:35 +02:00
dbc0ea9aff Disable debug lines to avoid compiler error 2018-06-07 16:20:51 +02:00
Nick Wu
42990349c6 Fixed include file error (caused by merge?) 2018-06-07 21:11:05 +08:00
89a843b7dc Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
2018-06-07 14:39:29 +02:00
Nick Wu
38cb2515df Fix snake mode reload. 2018-06-07 19:49:39 +08:00
Nick Wu
30947f2208 Now use one-time scene loading. Line/Polygon smooth added. 2018-06-07 18:56:17 +08:00
c5fbf68d68 Cleanup: Fix comment 2018-06-07 09:35:19 +02:00
212477f6ee Fix uniform name
The uniform variable name was wrong.
2018-06-07 09:24:01 +02:00
5d2f63c090 UI: More changes in Fill panel
Fix some issues with pattern type.
2018-06-07 09:22:09 +02:00
b40df071d8 Remove Onion Skinning override by Layer
This option is not required and only add complexity.

The UI panel was removed in a previous commit.
2018-06-07 09:10:45 +02:00
Nick Wu
79407c7b6e Uniform assign error fixed 2018-06-07 14:56:43 +08:00
Nick Wu
ee7e4a7d95 Fixed snake line taper error induced by combined batch. 2018-06-07 14:45:47 +08:00
3763f61104 UI: Remove duplicate "Layer" Header text
Now these panels are subpanels of Layer, so it's better don't duplicate name.
2018-06-07 08:08:03 +02:00
Nick Wu
54670f2722 Seperated different algorithms into 3 files. Init code minor changes. 2018-06-07 11:42:58 +08:00
Nick Wu
054e889a93 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
Conflicts:
	release/scripts/addons
	release/scripts/addons_contrib
	source/tools
2018-06-07 10:30:18 +08:00
5b17fa3388 Merge branch 'blender2.8' into greasepencil-object 2018-06-06 21:43:02 +02:00
ebaccc96a5 Cleanup: Fix comment typo 2018-06-06 20:18:10 +02:00
84eae294ae WIP: More changes in Fill Panel 2018-06-06 20:17:18 +02:00
5ed5c45e20 WIP: Redesign Fill Material Panel and options
- Change the Pattern style as an option inside Texture.
- Define only a gradient type with Linear or Radial modes.

Still the panels are not working with the right options by mode.
2018-06-06 19:57:42 +02:00
484acb2b61 Remove Opacity parameter for Colors
In order to keep consistency with Blender UI, the color has included the alpha factor in the same property and not as separated value.

This improves the material slots too, because now you can set the alpha directly.
2018-06-06 18:53:04 +02:00
9ae27c2d24 UI: Move Panel Adjustments and Relations as Subpanels of Layers 2018-06-06 18:46:59 +02:00
97fbe76b7b UI: Small changes to Fill Panel 2018-06-06 18:16:04 +02:00
3a08a3aff2 UI: Changes in Stroke Panel 2018-06-06 18:03:02 +02:00
b119607691 UI: Changes in Viewport Display Panel 2018-06-06 17:57:49 +02:00
9256f8d306 UI: Remove Apply Layer thickness 2018-06-06 17:47:16 +02:00
6316a6753e UI: More changes in Onion Panel 2018-06-06 17:42:44 +02:00
0e9a0f21c9 UI: Remove Panel Onion skinning by Layer 2018-06-06 17:35:43 +02:00
1e0ecd6d6f UI: Remove Lock and Delete frame
This is available in Dopesheet and Timeline
2018-06-06 17:27:01 +02:00
17d035db09 UI: Change Onion and Parent panels 2018-06-06 17:22:45 +02:00
9394609d4e UI: Change panel Layer Adjustments 2018-06-06 17:04:18 +02:00
0b4ef212b4 UI: Remove Debug option
This options must not be in the panel
2018-06-06 16:54:06 +02:00
9093ffdfa6 Fix errors after merge
There were brackets missing.
2018-06-06 16:24:46 +02:00
973e9e925e Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/space_topbar.py
	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
2018-06-06 16:23:23 +02:00
570c7280ff Fix errors after merge (main->bmain) 2018-06-06 10:39:45 +02:00
d82685f57e Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
	source/blender/blenloader/intern/versioning_280.c
2018-06-06 10:37:25 +02:00
6a7deb0bd5 UI: Remove debug option (show points)
This option is not needed in the panel.
2018-06-06 10:21:04 +02:00
900fd5ea62 UI: Rename Panel Display to Viewport Display 2018-06-06 09:19:55 +02:00
6bfd7c600e Fix error after merge 2018-06-05 17:10:16 +02:00
28e107f510 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
	release/scripts/startup/bl_ui/space_view3d.py
	release/scripts/startup/bl_ui/space_view3d_toolbar.py
2018-06-05 17:04:51 +02:00
6619fcc22d Merge branch 'blender2.8' into greasepencil-object 2018-06-05 14:01:03 +02:00
Nick Wu
3664b38618 Fixed depth occlusion stupid error. 2018-06-05 15:22:41 +08:00
Nick Wu
094e25752a Merge branch 'soc-2018-npr' of git.blender.org:blender into soc-2018-npr 2018-06-05 14:47:42 +08:00
Nick Wu
6a5cde3b74 Fixed complier-specific errors. Use force reload. 2018-06-05 14:39:34 +08:00
Nick Wu
3991d0805c Fixed complier-specific errors. 2018-06-05 13:34:01 +08:00
Nick Wu
9f8fbefc15 Added DPIX/Snake switch function. SceneLANPR out of sync with RNA, wierd 2018-06-05 11:36:22 +08:00
1609740341 Update submodule references
This change has been created by merge, but really does not change anything.
2018-06-04 20:12:06 +02:00
f2d856f3c6 Disable all modes after convert file 2018-06-04 20:11:12 +02:00
45c5d7a659 Disable missing flag
The WEIGHT flag must be disable too.
2018-06-04 20:08:56 +02:00
b9e62248ff Merge branch 'blender2.8' into greasepencil-object 2018-06-04 19:35:06 +02:00
Nick Wu
8d647a8f7d Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-06-04 23:43:47 +08:00
Nick Wu
4db17993a7 Removed debug Fragdata outputs 2018-06-04 23:42:27 +08:00
8ddf68b6a7 Fix rename missing in previous commit
These fields were not renamed in previous commit.
2018-06-04 17:25:17 +02:00
Nick Wu
1fe9a56112 DPIX implemented and running. 2018-06-04 23:18:00 +08:00
6f76154cf2 Remove deprecated data and move to new file conversion tools
These tools are included inside a file with DNA_DEPRECATED_ALLOW
2018-06-04 17:07:12 +02:00
e4f03e2304 Merge branch 'blender2.8' into greasepencil-object 2018-06-04 15:34:07 +02:00
3c03e24376 Merge branch '28' into greasepencil-object 2018-06-04 11:28:38 +02:00
604b673945 Merge branch '28' into greasepencil-object 2018-06-04 11:26:40 +02:00
71d300573a Merge branch 'blender2.8' into greasepencil-object 2018-06-04 09:06:15 +02:00
Nick Wu
6e44f612b0 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
Conflicts:
	release/scripts/addons
	release/scripts/addons_contrib
2018-06-04 10:14:22 +08:00
Nick Wu
cffef6cee5 Included DPIX Code, prevent compile. 2018-06-04 10:11:27 +08:00
fc2e0b6c6d Merge branch 'blender2.8' into greasepencil-object 2018-06-03 16:20:20 +02:00
47f4ca032b Merge branch 'blender2.8' into greasepencil-object 2018-06-03 09:41:32 +02:00
374e08db00 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/object.c
2018-06-01 19:38:27 +02:00
99cc3f81f3 Remap mode keymaps and solve merge issue
The keymap has been changed and there was a merge error.
2018-06-01 15:35:03 +02:00
ebd273db72 Merge branch 'blender2.8' into greasepencil-object 2018-06-01 15:20:37 +02:00
71d4bbf8da Merge branch 'blender2.8' into greasepencil-object
Conflicts:
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
source/blender/depsgraph/intern/builder/deg_builder_relations.cc
source/blender/makesrna/intern/rna_material.c
2018-06-01 13:21:20 +02:00
9911106534 More fixes after merge 2018-06-01 10:02:31 +02:00
d4eac6f998 Fix parameter values after merge
This python function needs different settings after merge.
2018-06-01 09:19:39 +02:00
4a9b3a76b5 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
release/scripts/startup/bl_ui/space_topbar.py
2018-06-01 09:13:08 +02:00
034c2c800e UI: Hide weight tools for non GP Objects
This poll method was missing in previous commit
2018-05-31 23:09:21 +02:00
93a61f4ab6 Merge branch 'blender2.8' into greasepencil-object 2018-05-31 19:26:06 +02:00
9e9453f1c6 Merge branch 'blender2.8' into greasepencil-object 2018-05-31 18:19:32 +02:00
6b53fc7b79 Fix color picker panel position
This is ahack to avoid the panel is shifted to the right. It looks the function to calculate the visible rect is using the toolbar size, but the view is full width.
2018-05-31 17:03:30 +02:00
1bc6089230 Merge branch 'blender2.8' into greasepencil-object 2018-05-31 16:50:13 +02:00
c3f08234aa UI: Back edit line button to previous place 2018-05-31 16:46:28 +02:00
bd7ccd4e95 UI: Remove redundanrt options moved to Top Bar 2018-05-31 16:11:33 +02:00
3a6328f389 UI: Replace icon 2018-05-31 16:06:45 +02:00
2e47506f8c UI: Move Multiframe ON/OFF to Topbar
Before it was inside the panel.

Thanks Pablo Vazquez for his help.
2018-05-31 16:02:49 +02:00
6e8a388e14 Do not hide grease pencil when disable Overlays
After adding the new grease pencil context modes, the draw must be done always.
2018-05-31 15:22:51 +02:00
7d294eade0 Merge branch 'blender2.8' into greasepencil-object 2018-05-31 13:29:57 +02:00
6c791e47ca UI: Fix multiframe ON/OFF option 2018-05-31 12:13:14 +02:00
76f84efcda Merge branch 'blender2.8' into greasepencil-object 2018-05-31 11:58:49 +02:00
9fc36300de UI: Fix curve controls
The template_curve_mapping is not working inside a box layout..
2018-05-31 11:58:08 +02:00
97f867f9f5 UI: Undo move to Top Bar for some panels with operators
The Top Bar must be used for settings only and never for operators.
2018-05-31 11:49:55 +02:00
2335390a3c Undo previous context change
These operators cannot be used in Top Bar, so this context is not required.
2018-05-31 11:47:37 +02:00
3e1fa48d39 UI: Move panels to Top Bar
Still some problems with operators using context data.
2018-05-31 11:07:18 +02:00
fc256d3233 Add TOPBAR context to poll functions 2018-05-31 11:06:41 +02:00
a155470363 Fix typo error in Stroke Panel 2018-05-31 09:52:55 +02:00
Nick Wu
e69e3553ed Implementing DPIX algorithm. (in progress, do not compile!) 2018-05-31 10:35:28 +08:00
9d47e56e47 UI: Move some panels to toolbar 2018-05-30 20:33:12 +02:00
2d65b34f16 Add new context modes for grease pencil
These modes were missing.
2018-05-30 20:15:53 +02:00
15b1acc6b5 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/properties_scene.py
        source/blender/makesrna/intern/rna_object.c
2018-05-30 19:28:24 +02:00
b44e74cd77 Cleanup inactive code 2018-05-30 17:47:30 +02:00
73b91e0d05 Merge branch 'blender2.8' into greasepencil-object 2018-05-30 16:57:19 +02:00
21e2cdce54 Rework in modifers apply parameters
Instead to pass the Context variable that it was used to get bmain pointer,now bmain is passed as parameter to reduce data and avoid any use of Context.
2018-05-30 16:52:37 +02:00
9af8923d82 Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object 2018-05-30 16:34:54 +02:00
eb66c19a5c Remove context parameter
This parameter is removed because Context must be avoided.
2018-05-30 16:33:18 +02:00
30ccca03d4 Redo mode settings after merge
This code section was changed in the last merge
2018-05-30 16:28:42 +02:00
5560722e34 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/include/ED_object.h
	source/blender/editors/object/object_edit.c
	source/blender/editors/object/object_ops.c
2018-05-30 16:25:09 +02:00
0894fb5749 Cleanup: shadowed var 2018-05-30 16:01:49 +02:00
bdd290cb81 Modify mode set routine to enable grease pencil modes
Now, when you press the numeric key to change mode, if the object is grease pencil, the grease pencil mode is enabled.
2018-05-30 16:00:04 +02:00
d038c07e4c Remove keymap for changing brush using numbers
This brush selection wil be replaced with spacebar and a menu.
2018-05-30 15:46:31 +02:00
aa722e8193 Remove old mode switching Keymaps
These keymaps are conflicted with new mode switching keymaps.
2018-05-30 10:27:53 +02:00
6d8bc03252 Disable old mode switching code 2018-05-30 10:27:14 +02:00
ba064952cb Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/addons
	release/scripts/addons_contrib
	source/blender/editors/object/object_edit.c
2018-05-30 08:47:44 +02:00
5edc1d475d Fix parameter list for some functions after merge 2018-05-29 17:59:45 +02:00
22a14f8d5c Merge branch 'blender2.8' into greasepencil-object 2018-05-29 17:38:28 +02:00
958a509c37 Filter dopesheet channel to OB_GPENCIL only
This filter using ob->data is evaluated for any object type and this can produce problems.

In the future, when grease pencil dopesheet will be merge with "normal" dopesheet, this section must be recoded.
2018-05-29 17:34:43 +02:00
Nick Wu
8b2722b200 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-05-29 22:16:35 +08:00
Nick Wu
c4583135e7 line drawing in one batch, greatly improve performance. modified UI. 2018-05-29 22:04:19 +08:00
f71cd9fb1a Cleanup: Rename depsgraph variable 2018-05-29 12:49:40 +02:00
762a08399b Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_edit.c
	source/blender/editors/gpencil/gpencil_paint.c
2018-05-29 12:38:38 +02:00
9fad3cc35c Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object 2018-05-29 10:08:22 +02:00
6b238fd4ae Fix missing renames in previous commit 2018-05-29 08:51:53 +02:00
92a69a383f Cleanup: some missing renames from last commit
Also whitespace edits
2018-05-29 08:51:41 +02:00
ead47fa2a2 Merge branch 'blender2.8' into greasepencil-object 2018-05-29 08:40:22 +02:00
663e918b09 Cleanup: rename color members in gpencil style
It reads like a bug to store alpha in variables named 'rgb'

Also remove some redundant casts.
2018-05-28 20:19:36 +02:00
8e54aaf41f Cleanup: remove gp_ prefix from variable names
These are already in a grease pencil struct.
2018-05-28 19:28:16 +02:00
b1097f17c6 Merge branch 'blender2.8' into greasepencil-object 2018-05-28 17:39:52 +02:00
Nick Wu
a51a683993 Merge remote-tracking branch 'remotes/origin/soc-2018-npr' into soc-2018-npr
Conflicts:
	intern/cycles/blender/blender_python.cpp
2018-05-28 21:55:49 +08:00
Nick Wu
07a132f695 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr
f32a7.
2018-05-28 21:49:20 +08:00
e0f33eb662 Merge branch 'blender2.8' into greasepencil-object 2018-05-28 15:28:21 +02:00
Nick Wu
9bf620392f fixed weird problem in blender/blender_python.cpp 2018-05-28 21:26:19 +08:00
Nick Wu
eb90e6944b Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-05-28 12:38:05 +08:00
Nick Wu
afbda949cf Snake works. Added color options. Performance need optimization. 2018-05-28 12:36:29 +08:00
34592648b7 Merge branch 'blender2.8' into greasepencil-object 2018-05-27 22:06:34 +02:00
f03895b9c6 Merge branch 'blender2.8' into greasepencil-object 2018-05-27 09:02:12 +02:00
490a342555 Merge branch 'blender2.8' into greasepencil-object 2018-05-26 09:02:27 +02:00
46db0fe3c8 Merge branch 'blender2.8' into greasepencil-object 2018-05-25 19:28:36 +02:00
1c6a39c924 Merge branch 'blender2.8' into greasepencil-object 2018-05-25 15:53:00 +02:00
9de639b0d5 Cleanup: Remove unused flag GP_STROKE_RECALC_COLOR
This flag was used when the color name was the link to the palette color, but now with materials this flag is not required.
2018-05-25 12:08:21 +02:00
a8fc8a5f7d Merge branch 'blender2.8' into greasepencil-object 2018-05-25 10:14:34 +02:00
Nick Wu
fe815dc4da Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-05-25 14:35:02 +08:00
Nick Wu
788f35a4d5 Vector okay, CEASH EXPECTED! 2018-05-25 14:33:03 +08:00
5bc9b73944 Tag COW after select to update strokes 2018-05-24 19:17:22 +02:00
ab5ba0cef8 Merge branch 'blender2.8' into greasepencil-object 2018-05-24 19:05:49 +02:00
710b0b6e8e Merge branch 'blender2.8' into greasepencil-object 2018-05-24 16:49:13 +02:00
44ded54154 Fix error converting old 2.7 files
The color name was deleted before conversion and the memory allocation was wrong.
2018-05-24 16:42:10 +02:00
e3f221a844 Cleanup: unused variable 2018-05-24 14:01:39 +02:00
6e37800070 Merge branch 'blender2.8' into greasepencil-object 2018-05-24 13:54:44 +02:00
Nick Wu
cde785e986 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-05-24 15:38:04 +08:00
Nick Wu
21045172ac what... 2018-05-24 15:35:37 +08:00
Nick Wu
80ec390d07 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-05-24 15:11:43 +08:00
Nick Wu
e37ff11312 changed a bit of argument uniform to match the API.(not working properly) 2018-05-24 15:10:29 +08:00
ae0de604e4 Merge branch 'blender2.8' into greasepencil-object 2018-05-24 08:31:25 +02:00
Nick Wu
241873023e Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-05-24 09:51:07 +08:00
Nick Wu
ad228f8e46 Edge thinning shader ok 2018-05-24 09:49:17 +08:00
09924fcdd1 Merge branch 'blender2.8' into greasepencil-object 2018-05-23 19:35:33 +02:00
91b7ee2ca3 WIP: Fix errors converting old 2.7 files
The brushes were not created and the palette must be removed.

The operator only works if Eevee engine is enabled. Cycles engine selected always fails.
2018-05-23 19:35:13 +02:00
Nick Wu
5cef17a439 Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr 2018-05-23 23:39:40 +08:00
Nick Wu
c7ef4704f9 Image filters ok, added ui adjustment(stub), prepared for vectorization. 2018-05-23 22:50:18 +08:00
852b5c58ab Merge branch 'blender2.8' into greasepencil-object 2018-05-23 16:38:09 +02:00
572b147d5b WIP: New operator to convert 2.7 grease pencil files
The operator convert the old 2.7x files to the new materials of 2.8.

This code is not defined in versioning code to avoid conversion of annotations.

Still pending some issues.
2018-05-23 16:37:32 +02:00
fe22793515 Merge branch 'blender2.8' into greasepencil-object 2018-05-23 10:37:10 +02:00
478c1ebb23 Cleanup: Reformat code 2018-05-22 19:35:15 +02:00
938a6c972a Cleanup: Fix comment 2018-05-22 19:29:04 +02:00
3502953167 Merge branch 'blender2.8' into greasepencil-object 2018-05-22 19:21:56 +02:00
350b660b65 Cleanup typo error 2018-05-22 19:20:11 +02:00
b9256d122f Move simplify options to Scene->RenderData struct
Before these change, the settings were defined in ToolSettings struct, but must be in the same struct that other scene simplify options.
2018-05-22 19:18:37 +02:00
67960e8d79 Cleanup: unused warnings 2018-05-22 16:52:41 +02:00
00907964d9 Merge branch 'blender2.8' into greasepencil-object 2018-05-22 16:42:22 +02:00
Nick Wu
7d1224406c Made a switch under Scene, and added files for LANPR adoptation. 2018-05-22 15:01:16 +08:00
0464a65ac3 Merge branch 'blender2.8' into greasepencil-object 2018-05-21 16:13:20 +02:00
26d507fbc0 Merge branch 'blender2.8' into greasepencil-object 2018-05-21 10:29:40 +02:00
5713dc558b Merge branch 'blender2.8' into greasepencil-object 2018-05-20 19:30:35 +02:00
60c4e20d9f Merge branch 'blender2.8' into greasepencil-object 2018-05-20 11:19:52 +02:00
b5dfa1108d Move random array function to BLI_rand
This function fills an array of random numbers
2018-05-20 11:17:43 +02:00
1b1baeeb0f Merge branch 'blender2.8' into greasepencil-object 2018-05-19 18:21:42 +02:00
c0ed6a6bea Remove scene->gpd deprecated 2018-05-19 18:20:56 +02:00
a1be8ef68e Fix merge problems and parameter list changes 2018-05-19 13:24:56 +02:00
f46e914448 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenkernel/CMakeLists.txt
	source/blender/blenkernel/intern/library.c
	source/blender/blenkernel/intern/library_query.c
	source/blender/blenloader/intern/readfile.c
	source/blender/blenloader/intern/versioning_280.c
	source/blender/collada/SceneExporter.cpp
	source/blender/editors/gpencil/gpencil_convert.c
	source/blender/editors/object/object_add.c
	source/blender/editors/object/object_relations.c
	source/blender/editors/space_outliner/outliner_draw.c
	source/blender/editors/space_outliner/outliner_select.c
2018-05-19 13:05:23 +02:00
2406b8b8d0 Verify pointer before assign material 2018-05-18 18:41:52 +02:00
ca69d50031 Cleanup: Check pointer before link 2018-05-18 18:39:25 +02:00
8b76fb8c28 Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object 2018-05-18 18:35:38 +02:00
8fc732d419 Refactor Brush Setting to new struct
This change moves the settings of grease pencil brush to a new sub struct.

WIP: Still not working the brush curves in the UI. The curves are working but don't appear in the UI panel.
2018-05-18 18:35:26 +02:00
577f93c399 Replace CFRA with DEG_get_ctime()
The CFRA value is not updated using COW.
2018-05-18 16:40:39 +02:00
3eab7fa512 Merge branch 'blender2.8' into greasepencil-object 2018-05-18 12:19:37 +02:00
bf375544cc Cleanup: use function to free weights 2018-05-18 12:16:49 +02:00
630f4a07d2 Replace CFRA with Depsgraph time to fix animation
The animation was not working because the number of current frame was not evaluated from depsgraph.
2018-05-18 10:38:43 +02:00
fb5e3fe050 Merge branch 'blender2.8' into greasepencil-object 2018-05-18 09:54:23 +02:00
c038ac8cad Modify rotate around cursor to use Trans Object
Now the object pointer is saved in the transformation data struct instead to use the viewlayer active object.
2018-05-17 19:28:16 +02:00
77ea4174d5 Merge branch 'blender2.8' into greasepencil-object 2018-05-17 18:57:14 +02:00
768fa47cf6 Add fix for rotation around cursor
NOTICE: This fix solves the problem rotating around 3D cursor, but it will need a review to use with multiedit.
2018-05-17 18:55:02 +02:00
19f7e2e674 Merge branch 'blender2.8' into greasepencil-object 2018-05-17 16:19:59 +02:00
0b4450124b Merge branch 'blender2.8' into greasepencil-object 2018-05-17 14:13:32 +02:00
0da4f410fb Merge branch 'blender2.8' into greasepencil-object 2018-05-17 10:05:56 +02:00
e6e46425aa Merge branch 'blender2.8' into greasepencil-object 2018-05-16 19:09:41 +02:00
895f4415f8 Fix error after merge: Parameter list change 2018-05-16 17:47:16 +02:00
1919eb7c9b Merge branch 'blender2.8' into greasepencil-object 2018-05-16 17:38:05 +02:00
5739e30fcb Add missing realloc for weights in RNA api
Fixed wrong weight field name too.
2018-05-16 17:22:52 +02:00
7532d611be Fix ruler weights array allocation 2018-05-16 17:18:50 +02:00
ff709b3784 Add missing weights array memory copy 2018-05-16 17:14:16 +02:00
ef4a169b94 Missing allocN line in previous commit 2018-05-16 16:47:56 +02:00
2ffbbfd67e Fix add primitive operator
The weight array was not reallocated.
2018-05-16 16:45:59 +02:00
304cb33533 Add initialization code for weights array
Cleanup unused code too.

Warning: This code is disabled, but add the fix for future use.
2018-05-16 16:40:26 +02:00
fceaa5f5f4 Define RNA properties for stroke weights 2018-05-16 16:34:57 +02:00
5c260a779c Cleanup: Remove old weights code 2018-05-16 16:10:37 +02:00
bd79c02c4b Fix error loading saved files
The weight array was not initializated.
2018-05-16 16:07:48 +02:00
5304756e2d Cleanup: Remove old unused functions
These functions were used by old drawing methods, but now they have been replaced with draw manager.
2018-05-16 16:00:13 +02:00
a7625df93e Cleanup: Remove unused parameter 2018-05-16 15:33:29 +02:00
82bffc68d8 Fix dissolve operator
The indices were wrong
2018-05-16 11:02:24 +02:00
f29b8c7fa8 Cleanup: Remove unused parameter 2018-05-16 10:51:17 +02:00
3e218ed6f5 ix simplify stroke segment fault
The index of the weights array was wrong.

WIP: Still there is a problem with  simplify adaptative.
2018-05-16 10:49:20 +02:00
03bb81f08d Fix field name error 2018-05-16 10:34:41 +02:00
619cc12b57 Add missing main weight array duplication 2018-05-16 10:16:31 +02:00
8f9e7de138 Fix segment fault when draw strokes
The subdivide was not reallocating the weights array.
2018-05-16 10:04:26 +02:00
9750e5c6f3 Cleanup: Remove duplicate and unused code 2018-05-16 09:48:34 +02:00
54be35123d Merge branch 'greasepencil-object' into experimental_gp_weight 2018-05-16 09:17:35 +02:00
cf53e1ca00 Merge branch 'blender2.8' into greasepencil-object 2018-05-16 09:16:54 +02:00
cffa00cbba Cleanup redundant code 2018-05-15 20:16:23 +02:00
13d411ccba Cleanup free code 2018-05-15 20:12:41 +02:00
c1c7df1c9c Move dupalloc outside duplicate function 2018-05-15 18:34:11 +02:00
3fe4232223 WIP: First compilation after change weights
This code is not tested, but as this is the first compilation without error, save this point as backup.
2018-05-15 17:55:49 +02:00
30beb53b78 WIP: Initial change of weight struct
This commit is not completed. Saved to get a backup point.
2018-05-15 14:04:15 +02:00
c5b72fd70e Rename field factor to weight
This is a previous step to move weights to MDeformVert
2018-05-15 12:52:45 +02:00
16ded67d80 Rename weight index field
This commit is a previous step to move the weights to MDeformVert and MDeformWeight
2018-05-15 12:45:38 +02:00
e6daa661bc Remove some deprecated scene->gpd
Still some pending.
2018-05-15 11:30:44 +02:00
f2f3bf48f8 Merge branch 'blender2.8' into greasepencil-object 2018-05-15 10:41:56 +02:00
2521a18dd7 Cleanup code 2018-05-15 10:17:17 +02:00
c5971d1f80 Cleanup: Define alpha field. 2018-05-15 10:17:17 +02:00
b5e1b13fe8 Fix inconsistent usercount handling of MaterialGPencilStyle.ima/.sima
Readfile was treating them as refcounted, RNA as user-one, and libquery
as not refcounted at all!

Full usercount makes more sense here, those images are used as 'real'
data for GP materials, not as temp setting of a brush!
2018-05-15 10:13:00 +02:00
6b5a67a0ae Cleanup: Fix unused parameter warning. 2018-05-15 10:12:33 +02:00
98bc64731f Cleanup: fix error w/ const arg 2018-05-15 09:37:41 +02:00
dfa87d3729 Cleanup: Remove duplicate parameter (cont.) 2018-05-15 09:31:32 +02:00
fcc41fafeb Cleanup: Remove duplicate parameter 2018-05-15 09:27:20 +02:00
5b12f86c84 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/transform/transform_snap_object.c
2018-05-15 09:09:53 +02:00
8839d96395 Merge Object cache allocate and add functions
As both functions are called always together, it's better to have in one only.
2018-05-14 20:26:31 +02:00
64e8d0eaa6 RNA: Replace material api 2018-05-14 19:54:57 +02:00
69bc2cb538 Remove DNADEPRECATED Scene->gpd from library_query.c
Deprecated DNA shall only be used in readfile?versionning code...
2018-05-14 18:32:56 +02:00
35e8acfe79 Add missing Object parent pointer from bGPLayer to library_query. 2018-05-14 18:32:56 +02:00
bff285a01a Merge branch 'blender2.8' into greasepencil-object 2018-05-14 18:27:18 +02:00
73b0aaacb8 Cleanup: Modify comments 2018-05-14 18:18:20 +02:00
05ab5b98c7 Cleanup: Add Comments 2018-05-14 18:07:07 +02:00
478cb94161 Fix merge error 2018-05-14 16:15:02 +02:00
e121fb7bfe Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/space_view3d.py
2018-05-14 16:02:14 +02:00
7a6fa7eab9 Merge branch 'blender2.8' into greasepencil-object 2018-05-14 09:33:46 +02:00
40eda4f69c Cleanup: Remove unused header file 2018-05-13 17:56:26 +02:00
3cc2165ec5 Merge branch 'blender2.8' into greasepencil-object 2018-05-13 17:23:48 +02:00
4735ea927b Add Depsgraph parameter to calculate evaluate object matrix
The matrix for object and parent object need to be evaluated using depsgraph to get the right value.
2018-05-13 17:21:53 +02:00
f492e4a96b Fix error with parent matrix using COW
The obmat must be the evaluated object, not the object itself.
2018-05-13 14:07:56 +02:00
7cd3a98417 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/transform/transform.c
	source/blender/editors/transform/transform_conversions.c
2018-05-13 13:08:24 +02:00
83df53ccc8 Cleanup: Rename eGP_BrushIcons items 2018-05-13 13:00:19 +02:00
7c2db4036d Remove duplicate colors properties
These properties were to allow to change alpha in list of colors, but it can produe errors with animation.
2018-05-13 12:06:38 +02:00
51c9497d19 Merge branch 'blender2.8' into greasepencil-object 2018-05-12 21:06:39 +02:00
930a7a7b76 Cleanup: Rename function 2018-05-12 21:06:00 +02:00
e8f5844b58 Cleanup: Rename inverse_xxx to invert_xxx and GP_xxx_INVERSE_xxx to GP_xxx-INVERT_xxx 2018-05-12 20:08:29 +02:00
93114b508a Cleanup: Rename gpencil_fill_simplyfy_lvl to gpencil_fill_simplyfy_level 2018-05-12 19:56:22 +02:00
8f1224688e Cleanup: Rename keep_stroke_thickness to show_constant_thickness 2018-05-12 19:53:50 +02:00
16037ceff0 Rename field cur_thickness to curve_thickness 2018-05-12 19:46:07 +02:00
7c78f66926 Cleanup: Remove unused declaration 2018-05-12 19:45:41 +02:00
8bfb6dbdae Add DNA_DEPRECATED to old scene gpd field 2018-05-12 19:45:21 +02:00
ad4e9ef956 Move bGPdata runtime data to bGPdata_runtime struct 2018-05-12 19:11:06 +02:00
e442206701 Add DNA_DEPRECATED to old Palettes 2018-05-12 19:05:59 +02:00
98f8f324d0 Move bGPDlayer runtime data to bGPDlayer_runtime struct 2018-05-12 19:03:49 +02:00
879a77b08b Remove view_layer option for render (F12)
This option allowed to filter a grease pencil layer by view layer, but after merge review it was decided to remove.
2018-05-12 18:57:51 +02:00
b038e849a7 Move bGPDframe runtime data to bGPDframe_runtime struct 2018-05-12 18:47:38 +02:00
e471663da6 Move bGPDstroke runtime data to bGPDstroke_runtime struct 2018-05-12 18:43:26 +02:00
ad9ed38594 Cleanup: Rename field falloff to multi_frame_falloff 2018-05-12 18:29:35 +02:00
7d9043511c Cleanup: Remove unused code 2018-05-12 17:36:16 +02:00
7507432ccf Cleanup: Remove unused total shaders fields
These fields were added to debug the nuber of shading groups created and to be sure all was removed.
2018-05-12 17:28:23 +02:00
607d2e807e Cleanup: Rename gpencil_geom.c to gpencil_draw_cache_impl.c 2018-05-12 17:15:36 +02:00
5c1c9a814e Cleanup: Rename gpencil_draw_cache_impl to gpencil_draw_utils.c 2018-05-12 17:12:34 +02:00
fcd6727f0e Cleanup: Reorganize functions 2018-05-12 17:08:04 +02:00
94130eff34 Fix stabilizer cursor line drawing
The cursor line was not correct because it was not using the Region visible rectangle and the line to last stroke point was adjusted as the stroke.
2018-05-12 16:49:59 +02:00
0aa2238205 Merge branch 'blender2.8' into greasepencil-object 2018-05-12 16:09:55 +02:00
a17123f670 Cleanup: modifier arg wrapping 2018-05-12 08:28:58 +02:00
986f895989 Merge branch 'blender2.8' into greasepencil-object 2018-05-12 08:28:11 +02:00
18b891111a Cleanup: warning 2018-05-12 08:27:35 +02:00
8f5bd85f39 Merge branch 'blender2.8' into greasepencil-object 2018-05-12 08:27:23 +02:00
1d0245b396 Move Render code to separate file 2018-05-11 20:02:20 +02:00
f5f64794c5 Fix cache_used error in previous commit 2018-05-11 19:44:22 +02:00
c3a9e6ad90 Reuse fullscreen quads instead to create new ones 2018-05-11 19:36:03 +02:00
f7f55485ba Cleanup: Remove debug lines 2018-05-11 19:33:19 +02:00
af0ba709f8 Remove DRW_gpencil_create_blank_texture function
This function is not needed and the same can be done with less lines.
2018-05-11 19:30:57 +02:00
c127e6cf83 Don't pass cache_used as pointer
The value is not changes and don't need the pointer.
2018-05-11 19:24:22 +02:00
bdc5b35c74 Move matrix initialization to stl initialization block 2018-05-11 19:16:28 +02:00
97507ba563 Cleanup: Remove unused code 2018-05-11 19:15:51 +02:00
65862c549e Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/space_outliner/outliner_draw.c
2018-05-11 18:29:25 +02:00
aa2dfe1b02 Rename grease pencil modifier callbacks
Add the prefix gp_
2018-05-11 18:27:00 +02:00
3001ce368b Fix operator to change brush size
The field was wrong after last rename
2018-05-11 18:17:48 +02:00
534a713dbf WIP: Remove duplicate fields gp_lazy_radius and gp_lazy_factor
These fields have been moved to existing smooth_stroke_radius and smooth_stroke_factor.
2018-05-11 18:09:32 +02:00
2f29a45986 Resuse Brush size field instead to use separated thickness field
Pending to reorganize Brush struct to remove unused pad bytes.
2018-05-11 17:54:35 +02:00
d2b6195bad Rename brush cur_xxxx to curve_xxx 2018-05-11 17:35:23 +02:00
a62cc866b1 Cleanup: More renames 2018-05-11 17:30:25 +02:00
9771c008da Rename gradient and texture fields 2018-05-11 17:13:55 +02:00
287703cc4f Rename functions to use "material" instead of "color" 2018-05-11 16:59:13 +02:00
60a99fbff6 Rename GPC_xxx to GP_STYLE_xxx 2018-05-11 16:56:50 +02:00
26f6036242 Rename struct GpencilColorData to MaterialGPencilStyle 2018-05-11 16:49:53 +02:00
ca20817c7c Rename field gpcolor to gp_style 2018-05-11 16:43:38 +02:00
2e9a10c9a3 Remove unused ADS_FILTER_NOPALETTE 2018-05-11 16:31:57 +02:00
6ddb176e7a Cleanup: More function rename 2018-05-11 16:25:09 +02:00
2079edea93 Rename BKE_gp_smooth_stroke to BKE_gpencil_smooth_stroke 2018-05-11 16:23:12 +02:00
cffb84d8b2 Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object 2018-05-11 16:20:11 +02:00
41957200b9 Rename BKE_gpencil_free_frame_temp_data to BKE_gpencil_free_frame_runtime_data 2018-05-11 16:19:53 +02:00
3a2935983c Cleanup: make LatticeDeformData private again
Matches master/2.8 branch.
2018-05-11 16:17:35 +02:00
c0e1771421 Cleanup: quiet warnings 2018-05-11 16:17:35 +02:00
b5f8c9d33e Cleanup: Replace () with {} 2018-05-11 16:16:42 +02:00
745ce35f8c Add missing break statement 2018-05-11 13:55:31 +02:00
6cb893f932 Merge branch 'blender2.8' into greasepencil-object 2018-05-11 13:53:34 +02:00
af88ef8336 Merge branch 'blender2.8' into greasepencil-object 2018-05-11 11:02:12 +02:00
ee11d4d556 Merge branch 'blender2.8' into greasepencil-object 2018-05-11 08:50:55 +02:00
6dd4622102 Merge branch 'blender2.8' into greasepencil-object 2018-05-10 17:53:28 +02:00
d0946b8420 Rename Gpencil<ModName>ModifierData to <ModName>GPencilModifierData 2018-05-10 17:52:49 +02:00
43993d7a55 Rename eModifierType_Gpencil<ModName> to eModifierType_GPencil_<ModName> 2018-05-10 17:00:43 +02:00
11cfa9eeda Merge branch 'blender2.8' into greasepencil-object 2018-05-10 08:41:40 +02:00
d2fc17fde3 Enable AA disabled by error in previous commit
This line was disabled by a temp commit to compile and must be enabled again.
2018-05-09 22:06:27 +02:00
77b58ec582 Merge branch 'blender2.8' into greasepencil-object 2018-05-09 19:00:24 +02:00
affd736c32 Cleanup: Style 2018-05-09 16:36:03 +02:00
00591fc2a7 Cleanup: Removing stuff that was added earlier but is no longer needed 2018-05-09 16:36:03 +02:00
05e5a72af5 Fix segment fault for modifiers with COW enabled
The curves in copyData was freed, but the pointer was not set to NULL.
2018-05-09 16:23:35 +02:00
8e4604949c Merge branch 'blender2.8' into greasepencil-object 2018-05-09 15:23:15 +02:00
52cf83d5a4 UI: Move "Move to Color" and "Select Strokes" operators from popup menu into the UI proper
This brings the GP materials UI more into line with the standard object materials UI
2018-05-09 15:10:35 +02:00
641eac4eab Cleanup: Remove unused code (was from when we still used palette colors) 2018-05-09 14:43:56 +02:00
5f6ade530b Fix: Don't show panels/complain if material doesn't have GP material settings 2018-05-09 14:24:46 +02:00
6674a754e6 Cleanup: Remove old cruft 2018-05-09 14:24:46 +02:00
5feb8317d8 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/properties_scene.py
2018-05-09 14:07:57 +02:00
96e759dd31 Merge branch 'blender2.8' into greasepencil-object 2018-05-09 10:04:57 +02:00
5484a03b2f Merge branch 'blender2.8' into greasepencil-object 2018-05-09 09:21:31 +02:00
ed5c95f2cd Cleanup: Remove "colorname" from GPStroke.new()
This isn't used now, so remove it to silence the compiler warnings here
2018-05-08 19:36:10 +02:00
ca8b80c321 Fix compiler warnings after API changes in 2.8 2018-05-08 19:12:28 +02:00
4d506e981e Merge branch 'blender2.8' into greasepencil-object
# Conflicts:
#	source/blender/blenloader/intern/versioning_280.c
#	source/blender/editors/gpencil/gpencil_edit.c
#	source/blender/editors/gpencil/gpencil_paint.c
#	source/blender/editors/gpencil/gpencil_utils.c
#	source/blender/editors/object/object_transform.c
2018-05-08 19:07:23 +02:00
74119ec5b0 Remove VFX simplify option 2018-05-08 18:15:07 +02:00
f010d2ef27 Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object
Conflicts:
	source/blender/draw/engines/gpencil/gpencil_engine.c
2018-05-08 18:08:42 +02:00
6537ab8812 WIP: Temporary/placeholder commit to get compiling working
Commented out all lines referring to vfx-related passes/buffers.
(Antonio: Please revert this commit, then commit proper fixes for each of these lines)
2018-05-08 17:56:38 +02:00
0b7cc1198b Remove VFX (more cleanup)
More changes to remove VFX modifiers and DOF.

Removed some unused code not removed in previous commit.

The temp texture A reused by general drawing has been enabled again (removed by error in previous commit) and renamed.

Fixed some lines removed by error in previous commit.

The modifer number in DNA_modifiers_types.h has been realigned to avoid any gap. This could produce some problems importing Hero files. Need check.
2018-05-08 17:55:14 +02:00
904e16f746 More build fixes - Removing more lingering modifier/dof defines 2018-05-08 17:55:04 +02:00
da246ccc50 More build fixes for VFX removal
Still not building, but these should also be safe
2018-05-08 17:33:01 +02:00
3e158b0a46 Remove VFX Modifiers + Defunct "DOF" Code
* As per code reviews (see T54721 and T54769), it was decided that the "VFX Modifiers"
  should not be in the modifiers stack, as they are not really modifiers. Instead, they
  are more like placeholders for shader effects on the object. For now, we simply remove
  these from the code, with a view towards designing a more general solution for all
  object types in 2.8 in future (e.g. as a "Viewport Effects" tab or similar in the Properties
  Editor)

* Also removed the "DOF" code. This was trying to copy what was done for Eevee, but the
  results were low quality, and the relevant code paths were already commented out.
  This code is also removed in this commit, as it depended a lot on many of the things
  put in place for the VFX modifiers, making removal of the VFX buffers complicated.
  Since it's not used now, it's not a big loss. Besides, with version control, we can
  bring this back in future.

NOTE: Blender still doesn't compile - there are still too many extra buffers hanging around
that need to be removed
2018-05-08 16:28:34 +02:00
44a4ed99ea Cleanup: Fix tabulation 2018-05-08 16:00:34 +02:00
3d60d221e4 Fix warning when select a object not GP
The onion skin panel needs a grease pencil layer.
2018-05-08 15:32:58 +02:00
8b9bd8a557 Cleanup: Operator properties for "GPENCIL_OT_multiedit_toggle"
* RNA_int -> RNA_boolean
* Rename "lines" to "toggle_visibility", as the previous name was ambiguous
2018-05-08 12:43:47 +02:00
d5ba36ecc1 Cleanup: Change the "back" parameter on GP editmode toggle operators from int to bool
It should have been a bool all along. However, it's debatable whether we should
even have this property to begin with, or a bunch of operators...
2018-05-08 12:38:35 +02:00
a6f9c29370 Fix: Re-enable toolshelf panels for GP tools
We will convert the UI later, so it can stay like this for now.
2018-05-08 11:48:00 +02:00
b4a4cbe7bb Cleanup: Simplify logic 2018-05-08 11:39:36 +02:00
cae3d19a8d Cleanup: Remove the old "total palettes" entry from the "Information" panel 2018-05-08 11:19:40 +02:00
46a58185ef Reshuffle order of panels in Propertes Editor -> Data, so that Datablock vs Layer settings aren't as mixed up 2018-05-08 11:18:25 +02:00
2eb0699272 Fix compiler warning - comment within comment 2018-05-08 11:05:06 +02:00
de00a05ade Merge branch 'blender2.8' into greasepencil-object 2018-05-08 10:49:37 +02:00
5bf9aca612 Merge branch 'blender2.8' into greasepencil-object 2018-05-07 17:28:05 +02:00
af11366d40 Fix AA error after draw manager changes
The AA was not working and the stroke was not visible while drawing due some changes in the draw manager.
2018-05-07 16:36:23 +02:00
b1accfaa19 Merge branch 'blender2.8' into greasepencil-object 2018-05-07 15:42:04 +02:00
74b338e57e Merge branch 'blender2.8' into greasepencil-object 2018-05-07 09:48:22 +02:00
a334ba5940 Merge branch 'blender2.8' into greasepencil-object 2018-05-06 17:41:38 +02:00
b9d8534161 Merge branch 'blender2.8' into greasepencil-object 2018-05-06 15:13:29 +02:00
a78341fe16 Cleanup: Remove unused and change comments 2018-05-06 15:12:17 +02:00
47402dd560 Color PIcker use list of materials not object materials
Now, the list shows all grease pencil materials and not only the materials of the active object.

If the material selected is not in the active object material slots, the material is added automatically when draw.
2018-05-06 13:37:48 +02:00
d10688dcee Cleanup: Rename function 2018-05-06 12:02:11 +02:00
a1b159d2f0 Cleanup: Remove unused parameter 2018-05-06 12:00:46 +02:00
8411afa034 Cleanup: Remove unused variable 2018-05-06 11:27:28 +02:00
2eb8779094 Use Brush material for Fill brush
Now the color used is the assigned to the brush and not the active color in material slots.
2018-05-06 11:25:22 +02:00
31a371f795 Fix compiler errors after merge 2018-05-06 10:51:19 +02:00
9b4931fdb7 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/makesdna/DNA_scene_types.h
2018-05-06 10:35:55 +02:00
c061daac12 Use as Brush Material default slot 1
Use always the first material as default if the brush hasn't assigned a material.

Before, the current slot was used as default, but this could create a misunderstanding and make the artist believe he could select the color in properties.
2018-05-05 17:17:32 +02:00
e4c6dee1d0 Merge branch 'blender2.8' into greasepencil-object 2018-05-05 12:06:45 +02:00
8c6a4a6512 Cleanup: Remove redundant function (and cleanup compiler warnings in the process)
BKE_gpencil_frame_color_duplicate() is no longer needed to perform Grease Pencil's
in-house "COW" operations. It was previously used to create a copy of the palette
datablock being used, and to then reassign all the color pointers. Now that that's
no longer needed, we can just use the standard one.

Note: BKE_gpencil_stroke_duplicate() has now been modified to NOT clear the triangles
array anymore. Instead, since most places that use this will clear/reallocate it
themselves, it's easier to just keep it there, making the COW stuff easier.
2018-05-04 18:53:18 +02:00
7726e46fe6 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
2018-05-04 18:43:27 +02:00
e455c54eae Cleanup: Fix code format broken by previous commit 2018-05-04 17:34:56 +02:00
ba770b0160 Make color picker panel set Brush Material
When select  a color in the panel, the color is assigned to the current Brush as its default material.
2018-05-04 17:19:51 +02:00
9dab54562b Use Brush material for drawing instead of Active slot
Instead to use the active material in the list of materials, now always use the material assigned to Brush.

If the brush hasn't a material assigned, then the current slot is assigned as the brush material and it will be used in the next drawings of this brush.
2018-05-04 16:53:49 +02:00
6075b7d362 Fix: Only show GP add shapes panel when GP object is active 2018-05-04 16:27:17 +02:00
3a605ed044 Fix print about removed properties
* show_only_render has been removed. Instead, this is now handled through the
  overlays popovers. Therefore, we no longer need (or should have) a dedicated
  button for this.

* Removed also the lock camera button. This shouldn't be here in the first place,
  as it was a dedicated workflow-specific hack added for the Hero production workflow
  only.
2018-05-04 16:13:10 +02:00
8d3684c8b9 Cleanup: Remove the now unnecessary modifier_index parameter from Modifier->generateStrokes() 2018-05-04 16:03:17 +02:00
38718a6b6a Merge branch 'blender2.8' into greasepencil-object 2018-05-04 15:48:58 +02:00
0a28eb6dbe Fix compiler warnings after merge
* Adapted various DRW_* identifiers that got cleaned up in 2.8

* BKE_gpencil_frame_color_duplicate() - should be removed

* File versioning code for GP annotation datablocks - knock this out for now
  (since it's causing compiling problems due to the view layer stuff being
  deprecated). We need to review whether we do this type of patching automatically,
  since we don't really want GP annotations to show up on Cycles renders for example.
2018-05-04 15:48:22 +02:00
68b8ea0d06 Fix GP modifiers after merge (formatting/extra fields added to modifiers) 2018-05-04 12:41:21 +02:00
d6a38803e1 Merge branch 'blender2.8' into greasepencil-object
# Todo's / Need Further Review:
# - material.c - "man->gpcolor = NULL" (commented out for now)
# - rna_material.c - "rna_Material_update()" - Should GP material settings use their own update?
# - GP Modifiers typedefines need updating for the new struct layout
# - Merge conflicts in properties_gp_common.py - Mostly due to panels being removed in GP branch
# - GP Panels in 3D View (toolbar/topbar fixes postponed till after branch merge)
# - GP "Paper" Option/Settings (should become overlay? Design work needed)

# Conflicts:
#	release/scripts/addons
#	release/scripts/addons_contrib
#	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
#	release/scripts/startup/bl_ui/space_view3d.py
#	release/scripts/startup/bl_ui/space_view3d_toolbar.py
#	source/blender/blenkernel/BKE_modifier.h
#	source/blender/blenkernel/intern/material.c
#	source/blender/editors/object/object_transform.c
#	source/blender/editors/space_outliner/outliner_select.c
#	source/blender/gpu/intern/gpu_shader.c
#	source/blender/makesrna/intern/rna_material.c
#	source/blender/modifiers/intern/MOD_armature.c
#	source/blender/modifiers/intern/MOD_array.c
#	source/blender/modifiers/intern/MOD_bevel.c
#	source/blender/modifiers/intern/MOD_boolean.c
#	source/blender/modifiers/intern/MOD_build.c
#	source/blender/modifiers/intern/MOD_cast.c
#	source/blender/modifiers/intern/MOD_cloth.c
#	source/blender/modifiers/intern/MOD_collision.c
#	source/blender/modifiers/intern/MOD_correctivesmooth.c
#	source/blender/modifiers/intern/MOD_curve.c
#	source/blender/modifiers/intern/MOD_datatransfer.c
#	source/blender/modifiers/intern/MOD_decimate.c
#	source/blender/modifiers/intern/MOD_displace.c
#	source/blender/modifiers/intern/MOD_dynamicpaint.c
#	source/blender/modifiers/intern/MOD_edgesplit.c
#	source/blender/modifiers/intern/MOD_explode.c
#	source/blender/modifiers/intern/MOD_fluidsim.c
#	source/blender/modifiers/intern/MOD_hook.c
#	source/blender/modifiers/intern/MOD_laplaciandeform.c
#	source/blender/modifiers/intern/MOD_laplaciansmooth.c
#	source/blender/modifiers/intern/MOD_lattice.c
#	source/blender/modifiers/intern/MOD_mask.c
#	source/blender/modifiers/intern/MOD_meshcache.c
#	source/blender/modifiers/intern/MOD_meshdeform.c
#	source/blender/modifiers/intern/MOD_meshsequencecache.c
#	source/blender/modifiers/intern/MOD_mirror.c
#	source/blender/modifiers/intern/MOD_multires.c
#	source/blender/modifiers/intern/MOD_none.c
#	source/blender/modifiers/intern/MOD_normal_edit.c
#	source/blender/modifiers/intern/MOD_ocean.c
#	source/blender/modifiers/intern/MOD_particleinstance.c
#	source/blender/modifiers/intern/MOD_particlesystem.c
#	source/blender/modifiers/intern/MOD_remesh.c
#	source/blender/modifiers/intern/MOD_screw.c
#	source/blender/modifiers/intern/MOD_shapekey.c
#	source/blender/modifiers/intern/MOD_shrinkwrap.c
#	source/blender/modifiers/intern/MOD_simpledeform.c
#	source/blender/modifiers/intern/MOD_skin.c
#	source/blender/modifiers/intern/MOD_smoke.c
#	source/blender/modifiers/intern/MOD_smooth.c
#	source/blender/modifiers/intern/MOD_softbody.c
#	source/blender/modifiers/intern/MOD_solidify.c
#	source/blender/modifiers/intern/MOD_subsurf.c
#	source/blender/modifiers/intern/MOD_surface.c
#	source/blender/modifiers/intern/MOD_surfacedeform.c
#	source/blender/modifiers/intern/MOD_triangulate.c
#	source/blender/modifiers/intern/MOD_uvproject.c
#	source/blender/modifiers/intern/MOD_uvwarp.c
#	source/blender/modifiers/intern/MOD_warp.c
#	source/blender/modifiers/intern/MOD_wave.c
#	source/blender/modifiers/intern/MOD_weightvgedit.c
#	source/blender/modifiers/intern/MOD_weightvgmix.c
#	source/blender/modifiers/intern/MOD_weightvgproximity.c
#	source/blender/modifiers/intern/MOD_wireframe.c
2018-05-04 12:21:12 +02:00
c52f6b11c0 GP Properties: Separate onion skinning for datablock + per-layer override into separate panels
The panel layouts are still a mess, but at least there's less code duplication
and weirdness now, with everything taking advantage of more conventions here.
2018-05-01 19:12:58 +02:00
00c54fb23a Cleanup: Material Buttons for GP
* Don't collapse panels by default
* Cleanup old code/names/etc.
2018-05-01 19:12:58 +02:00
60549a6680 Remove dirty cache calls from kernel
The function BKE_gpencil_batch_cache_dirty() must be called only from operators or RNA.

Besides, the calls removed were redundant.
2018-05-01 17:36:24 +02:00
dca23ccc4e Cleanup: Fix some more warnings
NOTE: For rna_GPencil_stroke_new(), the problems aren't entirely eliminated yet.
Specifically, the colorname arg is now unused - it was used in the past to
specify what color the new strokes should have.
2018-05-01 16:27:07 +02:00
69c042b7c9 Code Cleanup: Clearly label which parameters are used for input/output 2018-05-01 16:27:07 +02:00
356ce71a5f GPencil Editors API: Added utility function to be called to get Copy-on-Write evaluated copies of data
* Use ED_gpencil_get_active() for writing settings back to the original datablock
  (existing callback used in most operators now)

* Use ED_gpencil_get_active_evaluated() for getting the COW-evaluated geometry
  (i.e. with modifiers, etc.) applied. i.e.,
  ``` const bGPdata *gpd_eval = ED_gpencil_get_active_evaluated(C); ```
2018-05-01 16:27:07 +02:00
ed29a6fcbb Cleanup: Remove unused var 2018-05-01 16:27:07 +02:00
c70de3abab Cleanup: Fix indentation 2018-05-01 16:27:07 +02:00
4cb2d6d58c Revert to use again BKE_gpencil_batch_cache_dirty()
These functions were changed by error when replace dirty management by depsgraph.

The depsgraph is only valid for operators and the files included in this commit must call the function directly and don't use depsgraph tag.
2018-05-01 15:59:26 +02:00
7c5a146243 Back BKE_gpencil_batch_cache_dirty function
This function was removed by error in previous commit.
2018-05-01 15:50:15 +02:00
82150ed577 Cleanup: Add new line at EOF 2018-05-01 13:51:09 +02:00
63c91f2bbd Remove BKE_gpencil_batch_cache_dirty()
This remove the function because is not used.
2018-05-01 13:48:09 +02:00
8098dc3d10 Replace DRW_gpencil_batch_cache_dirty() with DEG_id_tag_update 2018-05-01 13:44:17 +02:00
a597e21dbd Cleanup. Rename material variable to "ma"
The old name "mat" could be confused with matrix.
2018-04-30 19:41:51 +02:00
50e91b6a61 WIP depsgraph fixes for GP and depsgraph
Still not working yet - somehow the updates aren't getting flushed yet
(perhaps COW related)
2018-04-30 17:41:56 +02:00
d45f1e93a8 Cleanup: Indentation 2018-04-30 17:41:56 +02:00
e6d4465f7f Add default brush material to object materials
When draw using a brush that uses a default material, the material must be added to the object material slots if this material was not before.
2018-04-30 17:22:21 +02:00
7a5747d559 Rename Grease Pencil Array Modifier to Instance Modifier
The new name is more clear and does not create confusion with 3D objects array modifier.
2018-04-30 17:09:42 +02:00
09c900b1bf Fix error drawing with no object active 2018-04-30 16:18:34 +02:00
f5608c3655 Cleanup: Remove redundant parameter 2018-04-30 14:07:54 +02:00
3397007cb6 Fix wrong Material name
The name was using the ID type.
2018-04-30 11:27:12 +02:00
Nick Wu
644cd00d1a Merge branch 'blender2.8' of git://git.blender.org/blender 2018-04-30 08:58:47 +08:00
77e79bea56 Fix error in Join objects
The index of the material must be stroke value + 1.
2018-04-29 16:59:02 +02:00
95fa3ab416 Cleanup: Remove old unused code for bGPDpalettes
This commit removes some functions not used from old bGPDpalette and bGPDpalettecolor.

These structs were used in version 2.78 and 2.79 and only keep the minimum number of functions to convert old files.
2018-04-29 16:01:49 +02:00
0b476cd44e Cleanup: Remove unused function 2018-04-29 15:48:03 +02:00
bab586e254 Cleanup: Reduce calls to get GpencilColorData
This avoids some duplicate calls.
2018-04-29 15:37:24 +02:00
e2893dad4f Fix separate operator using Materials 2018-04-29 12:42:42 +02:00
14ec05f561 Cleanup: Fix old comments 2018-04-29 11:36:42 +02:00
21a530e76d Enable again select by color using Materials 2018-04-29 11:33:52 +02:00
7dc60eac13 Cleanup: Comments 2018-04-29 11:24:26 +02:00
1115a3eef5 Enable default material by brush
This is an essential feature for pipeline.
2018-04-29 11:02:55 +02:00
e693329ea6 Fix comment typo error 2018-04-29 11:02:10 +02:00
27a41b45af WIP: Add Material to GP datablock relation node
This is only the first step to prepare the node
2018-04-28 19:54:49 +02:00
913693839c Fix memory leak when paste 2018-04-28 16:49:51 +02:00
1ecb9b6cc6 WIP: Fix more operators for copy
Still a memory segment fault when copy several strokes.
2018-04-27 19:33:08 +02:00
5512f02c51 Create hash of material colors for copy buffer 2018-04-27 18:34:07 +02:00
d6b0d2ae9b Fix operators to use Materials instead of Palettes 2018-04-27 17:58:11 +02:00
0cb40164f8 Convert old 2.7x files from Palettes to Materials 2018-04-27 17:29:22 +02:00
e19f017800 Clear deprecated colorname field when write data
This field must be cleared because the string is not used (deprecated).
2018-04-27 16:44:46 +02:00
a4642040df Fix mermory leak for materials
The materials array must be duplicated and free in every undo step.
2018-04-27 16:39:12 +02:00
7ce63dcf97 Add comment to make annotation for ToDo 2018-04-27 11:09:12 +02:00
da8ef484a5 Remove Palette animation Depsgraph node
As the Palette animation has been removed, these modules must  be removed.
2018-04-27 10:51:58 +02:00
8df4d2de02 Add notifier flag to update viewport
Whitout this flag, the viewport is not updated when change something in the material.
2018-04-27 10:27:50 +02:00
a042d30745 Fix error of missing slots
The problem was in the creation of material slot all the time. By default, the material is created when we have a slot already created.
2018-04-27 09:07:20 +02:00
98b58db9cb WIP: Fix error when drawing using a material
Still a problem adding slots
2018-04-27 08:56:01 +02:00
1e30188d68 Add GpencilColorData path for animation 2018-04-26 18:28:14 +02:00
5c9312afee Improve default Material use
If the default material has not the Grease pencil settings, add it instead to create a new material.
2018-04-26 17:42:07 +02:00
4141fd6be6 Undo previous commit for newlibadr_us
I added this by error.
2018-04-26 16:54:15 +02:00
57f83110da Create Grease Pencil Materials Settings for GP Objects only
If the material is created for a grease pencil object, a new GpencilColorData settings is initializated
2018-04-26 16:52:29 +02:00
473b95bb0b Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object 2018-04-26 16:23:20 +02:00
69383f6b5d Use newlibadr_us for layer parent object 2018-04-26 16:22:54 +02:00
4b469806fb Code Cleanup / Fix ASAN Crash
With ASAN enabled, Blender crashed when deleting the default cube
(why GP engine is even running at that point is a bit of a mystery to me).
Checking on this, I discovered that the code here had multiple pointers with
different names to the active object and the GP datablock it uses... time to
clean this mess up!
2018-04-26 16:16:03 +02:00
38f1aa8d66 Replace allowed types from Palettes to Materials 2018-04-26 16:15:11 +02:00
87c38a2ed7 Remove newdataadr and use newlibadr_us for images 2018-04-26 16:08:51 +02:00
5b633d7abe Fix several compiler warnings 2018-04-26 15:31:38 +02:00
ad36cee68b Fix recalc of UV using materials instead of Palettes 2018-04-26 12:54:05 +02:00
83a1498cea Change Default Brush material after refactor 2018-04-26 12:35:28 +02:00
1df04cb661 Fix missing palette reference 2018-04-26 11:50:12 +02:00
ee94211eb3 Merge branch 'experimental_gp_material' into greasepencil-object 2018-04-26 11:38:50 +02:00
792bd2a9f1 WIP: More work in the huge material refactor
The Monkey primitive, colorpicker and basic color handle operators working.

Still a big problem with save/load that produces a segment fault with any undo operation.
2018-04-26 11:33:37 +02:00
e20cbe29f9 WIP: Convert old palette operators
These operators are used to manage the strokes lock and hide.
2018-04-26 10:31:28 +02:00
55c2e89222 WIP: Mega Refactor to replace Palettes with Materials - 1 2018-04-25 20:19:49 +02:00
15bb1b4b45 WIP: Rename settings function in Draw Manager 2018-04-25 09:54:29 +02:00
1e126fb8a4 WIP: Replace field name for palettecolor 2018-04-24 19:31:06 +02:00
5396e284f7 WIP: First step to remove Palettes from Draw Manager
Still is not working.
2018-04-24 19:14:07 +02:00
da49c11d5d Cleanup: Rename material index field
Now the name is equal to other Blender areas.
2018-04-24 18:08:39 +02:00
0639de4ceb WIP: Start the working in operators
- Delete Material->Strokes
- Move material in the list->Reasign Strokes
2018-04-24 17:38:15 +02:00
b1e4f1a832 Remove Palette panels and fix write/read bugs
Now the panels works with materials but still the drawing engine and operators is using the old palettes.
2018-04-24 16:59:43 +02:00
9c1a5b0641 Fix error reading materials
The link materials section was missing.
2018-04-24 15:46:44 +02:00
1746aaa86f WIP: More work converting to materials
There is a problem with the loading of converted files.

The conversion of Hero data is correct, but something is still missing.
2018-04-24 13:48:45 +02:00
5f49b21c5e More work to prepare material conversion
Doing RNA stuff and preparing for convert Hero files
2018-04-24 11:19:31 +02:00
d5b6419878 Create new fields in material for moving palettecolor 2018-04-23 19:55:48 +02:00
d036fa0d6a Fix: ASAN-related crash when scaling points in editmode 2018-04-23 15:45:18 +02:00
43f95cd616 Merge branch 'blender2.8' into greasepencil-object 2018-04-23 15:42:45 +02:00
6b33e71843 Fix merge error 2018-04-23 10:09:13 +02:00
09b41b9ef1 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/addons
	release/scripts/addons_contrib
	source/blender/blenloader/intern/versioning_280.c
2018-04-23 10:08:20 +02:00
8e939dedfe Merge branch 'blender2.8' into greasepencil-object 2018-04-22 19:34:52 +02:00
8cd6f60695 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/properties_material.py
	release/scripts/startup/bl_ui/space_dopesheet.py
	source/blender/draw/modes/draw_mode_engines.h
	source/blender/editors/space_buttons/buttons_context.c
	source/blender/editors/space_time/space_time.c
	source/blender/editors/space_view3d/drawobject.c
	source/blender/editors/space_view3d/view3d_draw_legacy.c
2018-04-22 16:54:08 +02:00
1c53becdf7 Fix Tint and Hue/Saturation modifiers
Now the modifiers don't use the palettecolor pointer
2018-04-20 11:01:36 +02:00
63fcb0e749 WIP: Remove palettecolor pointer
Still Hue/Saturation and Tint pending.

Now both are disabled while found a solution.
2018-04-19 19:19:10 +02:00
036c95a655 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
	source/blender/editors/space_view3d/view3d_header.c
2018-04-19 17:13:17 +02:00
527d9c7295 Fix missing library Palette relink
The palette pointer was not relink as expected for Brushes and GP strokes.
2018-04-19 17:02:39 +02:00
378969bb25 Merge branch 'blender2.8' into greasepencil-object 2018-04-18 16:33:52 +02:00
51b282f404 Fix various compiler warnings/errors 2018-04-18 10:57:09 +02:00
46422a3517 Merge branch 'blender2.8' into greasepencil-object
# Conflicts:
#	source/blender/blenloader/intern/versioning_280.c
#	source/blender/makesrna/intern/rna_scene.c
2018-04-18 10:52:24 +02:00
8e9b1e3e80 Cleanup: Whitespace + Code Redundancy 2018-04-17 18:37:56 +02:00
3d3cc30df4 Merge branch 'blender2.8' into greasepencil-object
Tempting fate by merging in the Game Engine removal in here too...
We might as well do this now though, since it'll have to happen at
some time anyway!

# Conflicts:
#	release/scripts/startup/bl_ui/properties_scene.py
#	source/blender/blenkernel/intern/object.c
#	source/blender/blenloader/intern/versioning_280.c
#	source/blender/gpu/CMakeLists.txt
#	source/blenderplayer/bad_level_call_stubs/stubs.c
2018-04-17 18:28:08 +02:00
6d0795628d Fix: Putting back bakeModifierGP() for Lattice and Hook
Ideally, we'd run this on a depsgraph-copy, on a background thread. But, that's
that's something that we'd be passing through to the modifier bake callbacks.
2018-04-17 18:16:28 +02:00
19716326f4 MOAR compile fixes for GP branch after merge
Lots more fixes for various little things that broke after the merge and the
fixes required for that.

Unfortunately, I've had to disable a few things to get Blender compiling
again - those will require a bit more attention to fix.

Things currently broken/disabled:
* Apply/Bake for Hook and Lattice modifiers - disabled as we need to rethink how
  this works after EvaluationContext removal. Probably should go to a new depsgraph
  copy (instead of working in main depsgraph).

* Helplines for GP point edit - 1c9690e760 has been
  temporarily reverted due to conflicts with multiedit changes
2018-04-17 17:04:39 +02:00
261d64922b Merge branch 'blender2.8' into greasepencil-object
Note:
There were some additional changes needed due to the EvaluationContext -> Depsgraph
cleanups + MultiObject edit that happened in 2.8 since the last merge of 2.8 into
this branch.


# Conflicts:
#	release/datafiles/locale
#	release/scripts/addons
#	release/scripts/addons_contrib
#	source/blender/blenkernel/BKE_modifier.h
#	source/blender/editors/gpencil/gpencil_paint.c
#	source/blender/editors/include/ED_object.h
#	source/blender/editors/object/object_modifier.c
#	source/blender/editors/screen/screen_context.c
#	source/blender/editors/space_view3d/view3d_draw_legacy.c
#	source/blender/editors/transform/transform.c
#	source/blender/editors/transform/transform_conversions.c
#	source/blender/editors/transform/transform_generics.c
#	source/blender/editors/undo/ed_undo.c
#	source/tools
2018-04-17 16:05:37 +02:00
5626738541 Cleanup: Various code/style tweaks to GP code 2018-04-17 12:57:09 +02:00
00636eb618 Compiler warning fixes on GCC
* gpencil_add_*_shgroup() - Removed unused parameters (gpd)

* Fix warning about rgba being uninitialised in gpencil_fill.c::get_pixel()
  - The non-float case here looks like it shouldn't ever happen, but for good measure,
    I've added an assert + set a value here to keep compiler happy.

* Fix uninitialised var in gp_brush_drawcursor() - paintbrush

* GPencilOffsetModifier defined an RNA vertex group name set function, but didn't use it
2018-04-17 12:20:36 +02:00
a27a206902 Cleanup: various warnings
Now compiles w/o warnings for GCC
2018-04-16 21:20:51 +02:00
30575f9eaf Fix invalid brush assignments 2018-04-16 21:08:21 +02:00
c2517ae75a Cleanup: unused variables & args 2018-04-16 21:07:33 +02:00
6f0408f79d Cleanup: -Wparentheses & line length 2018-04-16 20:52:59 +02:00
a7c7d23542 UI Tweak: Rename "Grease Pencil" menu in 3D View to "Strokes"
Menu names in general should be a single word. Having two separate words makes it
visually confusing (i.e. it looked like there were 4 menu items, when in fact there
were only 3). Since the operators here operate on the GP strokes, it's reasonable
to use this term instead.

(Discussed with William as part of an informal UI review of GP branch)
2018-04-16 19:01:01 +02:00
8f22682a1a Fix compile error: Was missing 'const' qualifier 2018-04-16 18:57:48 +02:00
b2b02c6522 Merge branch 'blender2.8' into greasepencil-object 2018-04-16 09:58:44 +02:00
ba477d9ccf Merge branch 'blender2.8' into greasepencil-object 2018-04-15 16:18:33 +02:00
507113543a Fix compiler error in Windows 2018-04-14 16:24:06 +02:00
39ac621c2a Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/object.c
2018-04-14 16:11:12 +02:00
7281d36a20 Fix parameter list errors after merge 2018-04-13 16:05:33 +02:00
67801591f6 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/readfile.c
2018-04-13 15:54:39 +02:00
025615fe78 Fix compiler warning 2018-04-12 17:33:07 +02:00
3b203b738e Merge branch 'blender2.8' into greasepencil-object 2018-04-12 17:08:51 +02:00
e601228e01 Fix wrong color pointers for old files
Some files created for Hero during development had wrong color pointers. This fix this error and avoid a segment fault.
2018-04-12 17:03:35 +02:00
b95cd2f97d Fix compiler error after merge 2018-04-12 16:20:14 +02:00
c8f56d6613 Merge branch 'blender2.8' into greasepencil-object 2018-04-12 10:04:28 +02:00
02e60d6ffa Merge branch 'blender2.8' into greasepencil-object 2018-04-11 09:01:59 +02:00
8a6a173435 Merge branch 'blender2.8' into greasepencil-object 2018-04-10 13:47:04 +02:00
1c9690e760 Fix transform center after merge
This code fix the error of rotation center calculation, but need a review to check if this is the best way to do it.

I commit the change while we check other solutions  to be sure we have a correct rotation function.
2018-04-10 10:54:53 +02:00
17c8b2e4a8 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/transform/transform.c
2018-04-10 09:39:06 +02:00
07b304bc03 Merge branch 'blender2.8' into greasepencil-object 2018-04-09 10:17:09 +02:00
6635886df4 Fix error drawing in 2D editors
The UV calculation is only valid for 3D view.
2018-04-09 10:16:33 +02:00
2abd5fd8f9 Merge branch 'blender2.8' into greasepencil-object 2018-04-08 16:52:43 +02:00
073efa89cb Merge branch 'blender2.8' into greasepencil-object 2018-04-08 12:02:35 +02:00
68eeb56104 Refactor to reduce number of textures and framebuffers used 2018-04-08 11:21:04 +02:00
b2a549b010 Fix memory error for duplicated objects when exit
When duplicate an object, the batch cache was pointing to the original address and when close Blender, the pointer was invalid.
2018-04-07 16:10:49 +02:00
86f7bd43b6 Merge branch 'blender2.8' into greasepencil-object 2018-04-07 11:38:48 +02:00
d13a685d1c Revert antialiasing commit
The antialiasing was not working because the final image in default framebuffer is not used to calculate the AA pixels, so this double antialiasing was only adding drawing time.

We need to find a way to mix the grease pencil with the current default framebuffer with antialiasing.
2018-04-07 11:37:45 +02:00
25a3c3f11f Cleanup: Remove unused code 2018-04-06 16:17:44 +02:00
47051a44a0 Merge branch 'blender2.8' into greasepencil-object 2018-04-06 16:07:19 +02:00
034207497e Set cursor when change object mode
Cleanup workspace code and replace by change cursor function.
2018-04-06 15:52:59 +02:00
309b6378d3 UI: Fix object mode after merge 2018-04-06 14:25:36 +02:00
642bf42040 Add bContext to function
This parameter is required for grease pencil modifiers

Maybe need more work to remove the bContext, but we need it now to compile.
2018-04-06 14:20:13 +02:00
2d93fa6231 Try to fix the merge problems.
Warning: Now this source code does not compile
2018-04-06 10:37:21 +02:00
987b60100a Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/object/object_edit.c
	source/blender/editors/object/object_modes.c
	source/blender/makesrna/intern/rna_brush.c
2018-04-06 10:14:12 +02:00
23c5eee284 New Line Primitive
The straight lines could be done using Alt key while drawing, but it's better to have a simple primitive.

This has been requested by artists.
2018-04-06 10:11:04 +02:00
9920155e31 Add antialiasing when mix with default buffer on viewport
Still pending antialiasing if there are objects when render.
2018-04-05 19:05:12 +02:00
11bacaa705 Merge branch 'blender2.8' into greasepencil-object 2018-04-05 17:12:51 +02:00
38cdaa97fb Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/gpu/GPU_shader.h
2018-04-05 16:14:18 +02:00
8f366d494e Fix render after merge 2018-04-05 11:55:41 +02:00
64b778f666 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/render/intern/source/external_engine.c
2018-04-05 11:44:18 +02:00
159358e4ee Remove aspect ratio from VFX Blur on y-axis
The aspect ratio was not required here because deform the image.
2018-04-05 11:38:07 +02:00
659c5dcffb Improve render image blending
The blend of the Eevee/Cycles render and grease pencil render was not working as expected when grease pencil used transparency.

Now the blend is using blend equation with GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA
2018-04-05 11:34:07 +02:00
f18d8d84d1 Cleanup: Style 2018-04-04 17:41:50 +02:00
72204e2163 Cleanup: Add comments 2018-04-04 17:14:41 +02:00
9e46bbd305 Cleanup: Move cache functions to own module 2018-04-04 17:02:41 +02:00
162711fee2 Cleanup: Move vfx code and solve VFX order
All the code moved to vfx module and now the VFX modifiers are evaluated in the same order defined in the interface. Before, the order was always the same and did not use the interface order.
2018-04-04 16:37:28 +02:00
f536d5f821 Cleanup: Define variable using #define 2018-04-04 16:23:15 +02:00
dcd049321f Cleanup: Remove redundant object parameter for VFX 2018-04-04 16:17:07 +02:00
b756456929 Cleanup: Remove object index parameter for vfx 2018-04-04 16:10:55 +02:00
0a5c958275 Cleanup: More work to structure code 2018-04-04 16:07:22 +02:00
e286b359bb Cleanup. Create framebuffers in separate function 2018-04-04 16:00:18 +02:00
637b0154ad Cleanup: Create shaders in a separate function 2018-04-04 15:54:29 +02:00
96f4c3438e Merge branch 'blender2.8' into greasepencil-object 2018-04-04 15:44:58 +02:00
b8d9ff2989 Merge branch 'blender2.8' into greasepencil-object 2018-04-04 10:02:50 +02:00
e32c22d3a4 Add Lock to Focal Plane to Blur VFX
This optn works only in camera view and defines the blur factor depending of location of the object in depth of field. If the object is on a location inside near and far  depth of filed values, the blur is disabled.
2018-04-03 19:31:13 +02:00
3bfeb28b1e Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_data.c
	source/blender/editors/gpencil/gpencil_paint.c
2018-04-03 18:40:11 +02:00
5ed07515f5 Refactor VFX code
Make code more consistent and clear to understand.
2018-04-03 18:28:14 +02:00
d983eb44bc Allow zero samples for VFX Blur
When the number of samples is set to zero, the blur is dissabled, but this can be used to get effects animating the samples parameter.

If the zero is not a valid value, it is impossible to disable the blur with only this parameter.
2018-04-02 17:23:42 +02:00
ff0d4c7f1a Fix reproject error drawing lines
The reproject was done two times and must be done only once.
2018-04-02 16:40:54 +02:00
2f46b16b0e Cleanup redundant variable 2018-04-02 16:33:45 +02:00
b6d63d5a97 Fix errors after merge 2018-04-02 16:18:52 +02:00
f01b8bcd0b Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/space_outliner/outliner_select.c
2018-04-02 15:58:34 +02:00
70d7939778 Cleanup: Make code more compact 2018-04-01 16:23:50 +02:00
0890922dbd Recover line deleted by mistake in previous commit
Still there is a problem when the undo change to a non GP object.
2018-04-01 16:03:44 +02:00
627a27dc69 Fix error after merge 2018-04-01 12:45:21 +02:00
7e4d6bcb88 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_data.c
	source/blender/editors/gpencil/gpencil_edit.c
	source/blender/editors/util/undo.c
2018-04-01 12:25:58 +02:00
b9c5863fb6 Fix color names for monkey
The colors were missing after save and load again.
2018-03-31 18:56:01 +02:00
b1e3bb9eb4 Cleanup: Move all Shader creation to engine_init 2018-03-31 18:55:49 +02:00
7d27a537b9 Merge branch 'blender2.8' into greasepencil-object 2018-03-31 09:01:45 +02:00
4d45ea99e0 Fix blur shift when add more samples
The image was moved to top when increase the sample number. This was due the shader was bluring both axis at the same time.
2018-03-30 16:38:50 +02:00
3a8a749212 Cleanup: Use always even numbers for samples 2018-03-30 16:29:17 +02:00
e2100a698b Cleanup: Simplify shader parameters 2018-03-30 16:16:41 +02:00
984d5da990 Restructure VFX Blur, add Samples and cleanup
Now, the number of defined passes is low and there is a new parameter to define number of samples.
2018-03-30 13:47:34 +02:00
1e163414da Merge branch 'blender2.8' into greasepencil-object 2018-03-30 12:17:43 +02:00
ee1931e306 Cleanup unused variable 2018-03-29 19:58:12 +02:00
a954837eae Replace constant bokeh value by parameter 2018-03-29 19:38:43 +02:00
68aff2fb88 Fix compilation error after merge 2018-03-29 17:58:09 +02:00
d1130c5f4e Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/gpu/GPU_shader.h
2018-03-29 17:40:51 +02:00
c80bb336d6 Fix DOF render segment fault and use Eevee UI options
To activate the DOF for grease pencil, the Eevee option is used as main flag.
2018-03-29 16:56:47 +02:00
67638e3136 Merge branch 'greasepencil-object' into GP-DepthOfField 2018-03-29 10:27:21 +02:00
bbde146ebc Merge branch 'blender2.8' into greasepencil-object 2018-03-29 10:26:47 +02:00
71bac9a99f WIP: Fix alpha channel and replace by weights
Still there is a problem with the external border.

Thanks Clément for the help.
2018-03-29 10:23:25 +02:00
e4c6746c31 WIP: More work on shaders and framebuffers for DOF
Still there are problems with the alpha factor and all the scene is empty because alpha is always 0.
2018-03-28 19:59:08 +02:00
fbc1b12aa8 Remove texture Free for DOF
These textures are freed by draw manager and don't need explicit free.
2018-03-28 19:11:27 +02:00
db9244bb7e Fix wrong function to assign texture to shader 2018-03-28 19:06:33 +02:00
b8272f724a WIP: Start to add DOF support
Still is not working. Save this commit as reference.
2018-03-28 18:09:12 +02:00
96666d38c6 Merge branch 'blender2.8' into greasepencil-object 2018-03-28 08:54:10 +02:00
c4b4719dcf Cleanup comments 2018-03-27 19:27:11 +02:00
9e0674d519 Cleanup shader code 2018-03-27 19:11:13 +02:00
2f9f3d09a9 Fix alpha double blend
The color when used alpha factor always got darker. The problem was a double blend that produced a reduction in the color saturation.

Now, there is a premult of the alpha factor before doing last blend pass.

As a result of this change, now the drawing process can be simplified and a pass can be removed. Some cleanup done too.

Still need more work in render mode. Maybe the problem in render is related to Tonemapping.

Thanks Clément Foucault for his help solving this issue.
2018-03-27 18:03:26 +02:00
d7046c4668 Merge branch 'blender2.8' into greasepencil-object 2018-03-27 10:47:11 +02:00
7bacfd320a Merge branch 'blender2.8' into greasepencil-object 2018-03-26 17:46:03 +02:00
c3c6f6e3b5 Fix multisample for render
After last merge, the multisample was not working in render mode.
2018-03-26 17:44:46 +02:00
e15e307d4c WIP: Fix texture format after merge 2018-03-26 11:32:33 +02:00
32beb07b25 WIP: Refactor darwing code after merge
A lot of changes were done in draw manager in the last merge.

This commit fix the main area, but still problems with multisample frame buffer.
2018-03-26 11:29:08 +02:00
69dfaeb96e Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/draw/intern/DRW_render.h
	source/blender/draw/intern/draw_manager_framebuffer.c
2018-03-26 10:40:29 +02:00
3265ed2d2e Fix grease pencil paper reset loading files
The paper was reset loading any file, not only old files.
2018-03-24 13:45:35 +01:00
c3fa124d46 Make less sensible strength brush and smooth
Now the factor to apply is less sensible and after apply the strength a smooth operation is done with surrounding points.

Before the change in the opacity changed too much with small input.
2018-03-24 13:09:46 +01:00
60e18bf431 Cleanup: Fix comments 2018-03-24 12:54:34 +01:00
dcbd96eb18 Merge branch 'blender2.8' into greasepencil-object 2018-03-24 12:20:37 +01:00
eaa9d64ce9 Merge branch 'blender2.8' into greasepencil-object 2018-03-23 14:05:51 +01:00
176d2acbb5 Merge branch 'blender2.8' into greasepencil-object 2018-03-22 19:22:20 +01:00
ccf3889b30 Merge branch 'blender2.8' into greasepencil-object 2018-03-22 19:13:41 +01:00
4c078cb2af Cleanup: Make code more compact 2018-03-22 17:24:40 +01:00
619d989600 Update depsgraph for stroke transforms
This is required to work with COW
2018-03-22 16:45:44 +01:00
d767fc2e27 Update depsgraph for sculpt and select
This is required to work with COW
2018-03-22 16:45:18 +01:00
6ebab4a90a Fix simple points drawing with line mode
If using line mode, simple points must be drawn with point shader, not line shader.
2018-03-22 16:20:32 +01:00
e3af67703e Cleanup unused code block 2018-03-22 16:13:54 +01:00
cf521a7f32 Update depsgrah tag while painting
If this update is not done, the cow object used for display, does not show the current stroke.
2018-03-22 16:10:22 +01:00
54ede1d53a Force Depsgraph recalculation when cache is dirty 2018-03-22 10:23:11 +01:00
0b0d3e67c6 Cleanup: Remove redundant code 2018-03-22 10:06:42 +01:00
3fc0c418a1 Remove Custom Brush icon
Now the user can assign as icon any custom image with the brush options.
2018-03-21 19:49:12 +01:00
fc18bfc532 UI: Replace Eraser icons 2018-03-21 19:44:13 +01:00
c47c6a32ea Cleanup: Rename field and add comments 2018-03-21 17:35:31 +01:00
71f465b01a Use evaluated camera for render 2018-03-21 17:14:11 +01:00
2c0acc9eb5 Merge branch 'blender2.8' into greasepencil-object 2018-03-21 16:48:17 +01:00
28a6ed8885 Remove use of LIB_TAG_NO_MAIN for temp objects
Instead to use the tag to identify temp objects, now a internal flag managed by cache is used.

This is required because the LIB_TAG_NO_MAIN created conflicts with depsgraph.

This solves any concern of D3111
2018-03-21 16:47:01 +01:00
9bdd8a4aa5 Cleanup: Get rid of last uses of BKE_gpencil_batch_cache_alldirty_main()
* For any cases that weren't operating on a specific bGPdata instance,
  the DEG_id_type_tag() should do the trick to tag all GP datablocks.

* For the palette case, tagging the palette should trigger just the
  GP datablocks using that palette (and not all of them) to get updated.
2018-03-21 19:19:59 +13:00
b59139eddc Merge branch 'blender2.8' into greasepencil-object 2018-03-20 19:47:36 +01:00
9ab33bf9be Cleanup: Remove unused definition 2018-03-20 19:47:04 +01:00
c01e6a3c50 Cleanup: Improve comments 2018-03-20 19:30:40 +01:00
286d4e77a7 Fix error with copy-on-write
Verify tag of cow before remove temp objects.
2018-03-20 18:59:59 +01:00
5c47c5de68 Fix Users count
The value must be 2, not 3.
2018-03-20 15:56:32 +01:00
d0ce4d838b Fix problem to enter in edit mode with Tab key 2018-03-20 12:41:58 +01:00
3c5342649b Cleanup: Move GP Object specific properties panels to properties_data_gpencil.py
Note:
* Layers and Onion Skinning panels haven't been moved yet.
  This is so that we can reconsider what (if any) changes
  need to be made to share common elements between GP Object
  and annotation GP use cases.
2018-03-20 20:14:48 +13:00
e2b78f68a8 Cleanup: Remove unused code 2018-03-20 17:13:56 +13:00
5dd8c7fa42 More Brush Appearance Panel tweaks
* Always show this panel. Previously, it wouldn't get shown for the Eraser,
  meaning that if you accidentally changed a brush to an eraser, you couldn't
  change it back

* Always allow changing the brush icon. Previously, this could only be done
  for "Draw" brushes, but there isn't really any reason why this shouldn't
  be allowed.
2018-03-20 17:01:48 +13:00
c6ecbb9508 Brush Appearance Panel - Cleanup + Tweaks
* The "Draw" case was discarding the settings.brush value and redefining
  its own brush variable. Reoranised code so that this doesn't need to
  happen
* Reorganised order of properties - all brush type/icon related stuff
  comes first now
* Remove extra/excess layout elements/lines
2018-03-20 16:58:28 +13:00
5d96c8abb4 Don't collapse "Brush Appearance" panel
It's in a tab by itself already, so there's no need to make ti even harder
to access its settings.
2018-03-20 16:37:09 +13:00
404e817a11 Merge branch 'blender2.8' into greasepencil-object 2018-03-20 16:14:20 +13:00
4e33ce736f Change library order 2018-03-19 20:35:31 +01:00
350cd7fce2 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	build_files/cmake/macros.cmake
2018-03-19 19:46:31 +01:00
dd4e968bea UI: Move brush type to appearance panel
This option is not used all the time and putting in the main panel, near of the brush selector, can be weird for the user.
2018-03-19 19:43:28 +01:00
03c3136c10 Cleanup: use MEM_SAFE_FREE 2018-03-19 09:56:41 +01:00
cb8ebffa48 Merge branch 'blender2.8' into greasepencil-object 2018-03-19 09:39:28 +01:00
d435719fb4 Do not draw fill control lines in multiwindow
If enable the fill control lines, these must be drawn only in the current window.
2018-03-19 09:38:01 +01:00
2042995dce Cleanup: Warnings and Codepage errors 2018-03-18 12:10:42 +01:00
ae1a08632c Merge branch 'blender2.8' into greasepencil-object 2018-03-18 11:48:36 +01:00
5c47a33362 Enable Loop Onion in Relative mode 2018-03-18 11:48:06 +01:00
d5a6568816 Fix link Palette error with textures
The link was not loading the referenced images.
2018-03-17 17:01:10 +01:00
ea63d431f1 New Onion Skinning Loop option
When draw an animation with a loop it's very useful to have an indication of the first frame.

Some changes in the order of the parameters too.
2018-03-17 16:48:46 +01:00
5330415de2 UI: Move angle factor to top of the panel 2018-03-16 18:54:29 +01:00
ab42439d52 Merge branch 'blender2.8' into greasepencil-object 2018-03-16 18:07:52 +01:00
a900b2d2a1 Replace Random checkboxes by Factors
As we have a new Random section in the stroke panel, it's not logic to have buttons in the main panel.

Now, these random parameters work equal to other random factors.
2018-03-16 18:07:06 +01:00
988d180616 UI: Remove unlink text for default palette
This is not standard and we remove while we found a better solution.
2018-03-16 15:44:33 +01:00
bccbc935a0 Outliner: Clicking on GP Layers will activate them 2018-03-17 03:09:26 +13:00
Dalai Felinto
82ab5668d0 Fix bug: Appended brush comes with empty palette 2018-03-16 10:10:39 -03:00
06d9f59a42 Merge branch 'blender2.8' into greasepencil-object 2018-03-16 10:55:03 +01:00
7ded480dff Reset color name only if not valid for the palette 2018-03-16 10:51:38 +01:00
a107b3d8d7 Fix compiler error (field name wrong) 2018-03-16 10:48:10 +01:00
80840750e8 GP Color Picker - Make the highlight cover the names of each color too
This makes it more consistent with the normal big-icon popup menus
2018-03-16 19:33:12 +13:00
be53b9afe5 Fix: Adding GP Monkey didn't refresh Properties Editor 2018-03-16 19:19:19 +13:00
b9090d9229 Fix: Prevent GP Primitives (Rectangle/Circle) from getting added when active layer is locked/hidden 2018-03-16 19:06:34 +13:00
6cdba8893f GP "Add Monkey" - Shift-A can now be used in EditMode to bring up the "Add GPencil Object" menu
TODO:
It shouldn't trigger in other editors, but right now, the keymaps are
shared, so there's not much that can be done about that.
2018-03-16 18:50:27 +13:00
fabfa5a959 GP "Add Monkey" - Check if there's an existing palette/colors with the required names before adding new ones
Now, when adding a Monkey primitive to the same GP object more than once,
you won't get two separate palettes (with two separate sets of colors)
created - one for each instance. Instead, the second (and subsequent)
copies will all use the initial/existing palette instance.

Note: For layers, we still just create new ones, as it makes it easier to
isolate the instances.
2018-03-16 17:16:28 +13:00
a5e8b369e7 GP "Add Monkey" - Make this behave like a standard "Add Object" operator
* "Add GP Object" operator now works in Edit/Paint modes (so the button
  in the Create tab works)

* Multiple "Suzanne" objects can be added within the same GP datablock now
  (if in Edit/Paint modes when activating the "Add GP Object" operator)

* "Radius" operator property is respected, albeit, setting this to values
  other than 1.0 may result in weirdness as the line thickness values do
  not get adjusted.
2018-03-16 16:09:17 +13:00
0481990044 GP "Add Monkey" - Primitive geometry can now have arbitrary transforms applied to it when created 2018-03-16 16:09:16 +13:00
d00b952d4d Remove duplicate RNA name set
This broke the name property of the layer.
2018-03-15 18:49:37 +01:00
9c0eb5fe8b Merge branch 'blender2.8' into greasepencil-object 2018-03-15 17:38:36 +01:00
1c58439bef Save Simplify flags at drawing start
As the simplify can change during play, the cache was not initializated and could get an error.

Saving the flags at the start solves this issue and improve the play animation in few mseconds.
2018-03-15 17:24:31 +01:00
b3638bdd20 Missing copy curves for brushes 2018-03-15 13:23:17 +01:00
1730ef7527 Fix simplify bug due cache corruption
When enable/disable simplify options, the cache must be set as dirty.

Now, the update is done using depsgraph.
2018-03-15 13:07:04 +01:00
3b11365e96 Merge branch 'blender2.8' into greasepencil-object 2018-03-15 12:41:24 +01:00
37e8dd2b94 Add filter by View Layer when render (F12)
Now it's possible to filter the grease pencil layers by view layer for render. The filter can be inverted.

This is an additional level of object visibility.

This is used for compositing.
2018-03-15 12:02:33 +01:00
c1cd722171 Fix assert error linking palettes
Must check if the hash key was inserted before.
2018-03-14 19:44:09 +01:00
c05da356b1 Merge branch 'blender2.8' into greasepencil-object 2018-03-14 18:59:40 +01:00
3c9c9dcb32 Merge branch 'blender2.8' into greasepencil-object 2018-03-14 10:21:12 +01:00
7ac4a31ab1 UI: Add icon selector
Now it's possible to select the standard icon used by brush. This can be required when change the brush type and want to back to old icon.
2018-03-14 10:10:35 +01:00
94597cd43c Cleanup: Move enum definition to right file 2018-03-14 09:54:26 +01:00
08970951c6 Cleanup: Group all paint creations in function 2018-03-14 09:49:44 +01:00
7438a391d8 UI: Expand brush type icons
The old dropdown list button was too wide and the look of the icons below was strange.
2018-03-14 09:40:57 +01:00
3347e8f812 Add missing ID types for Brushes and Grease Pencil 2018-03-14 08:44:19 +01:00
46b2492fb2 Merge branch 'blender2.8' into greasepencil-object 2018-03-13 19:44:18 +01:00
3fd7dcad9e Fix cursor error after erase brush
When the brush is not selected, the cursor must be hidden.
2018-03-13 19:42:46 +01:00
7771049641 UI: Add a text for not linked palettes
I had to use a trick with a disabled button because the template_id collapse when nothing is selected.

Here  the operator new is not logic, so we cannot add the common "+ new" button.
2018-03-13 16:11:16 +01:00
90e005e567 UI: Hide cursor color for drawing brushes 2018-03-13 15:49:40 +01:00
09ede1f3bb UI: Move default color to main brush panel 2018-03-13 15:47:18 +01:00
118f7e28f3 Increase User number for palettes 2018-03-13 15:45:21 +01:00
fde0e44aa4 Use Brush default color for cursor
If the brush has assigned a default color, the cursor must use this color, not the context default color.
2018-03-13 15:16:17 +01:00
6f83bc24b5 Fix problem when change mode in brush color default 2018-03-13 13:06:25 +01:00
338903f5f5 New default color for Brush
If the brush defines a default Palette and Color, when draw the color used is this and not the current context default color.

Still there is problem when change drawing mode from Line to Dots.
2018-03-13 12:59:19 +01:00
8d1538fbf5 Merge branch 'blender2.8' into greasepencil-object 2018-03-13 10:55:40 +01:00
f9e280dafe Cleanup unused code 2018-03-12 16:48:34 +01:00
5f3bcba63e UI: Change brush type icon and panel layout
Small modifications to some parameters and added text to type of brush.
2018-03-12 16:34:39 +01:00
6722c6e5a8 Cleanup: Remove duplicated condition 2018-03-12 10:36:03 +01:00
f012e1de32 Remove brush mode panel and add icon
The panel was not needed and was replaced by icons in the main panel.

Notice: I have reused standard icons, but maybe need custom icons in the future, but we will wait to the main redesign 2.8 interface task.
2018-03-12 10:30:02 +01:00
a83065a5d3 Merge branch 'blender2.8' into greasepencil-object 2018-03-12 10:00:46 +01:00
301651ae51 Change Brush names to organize alphabetically
As the panel is sorted by name, it's better to have names that keep brushes grouped.
2018-03-12 09:53:53 +01:00
95655f008c Change Eraser icon depending of eraser mode 2018-03-12 09:49:25 +01:00
ff2260527f Remove unused and duplicate code
After moving bGPDbrush to Brush, some data is duplicated or not used.
2018-03-12 09:37:03 +01:00
944812a1e8 Fix problem when change mode if no brushes
When chnage mode, create the default brushes if they are missing.
2018-03-11 20:12:18 +01:00
03c4d48cda Fix problem with Brush Datablock icons
The icons of grease pencil brushes did not work because the poll return false.
2018-03-11 20:04:11 +01:00
4071460fe1 WIP: more work moving datablock
All references to old bGPDbrush struct has been removed and basic functionality working again now.

Still the icons of the brushes are missing.
2018-03-11 18:03:30 +01:00
c44e8a016b WIP: Fist step moving bGPDbrush to Brush datablock
Still a lot of work ahead, but this commit is to save the situation before remove bGPDbrush struct.
2018-03-11 11:48:29 +01:00
d093792ab6 Code refactor: Missing in previous commit 2018-03-10 13:29:07 +01:00
20ddf3a147 Code refactor: Rename fields to prepare for ID datablock
Rename some fields to prepare the code to move the brushes (bGPDbrush) to reuse ID datablock ID_BR (Brush).
2018-03-10 13:25:36 +01:00
739a9cef23 Merge branch 'blender2.8' into greasepencil-object 2018-03-10 12:24:01 +01:00
65ec69492d Cleanup: Rename brush input_samples field 2018-03-09 19:38:07 +01:00
d610ef059a Cleanup: Rename brush type field 2018-03-09 19:27:22 +01:00
040ec894a4 Cleanup: Rename brush icon field 2018-03-09 18:31:48 +01:00
827a5289ef Cleanup: Rename subdivide field 2018-03-09 17:52:49 +01:00
afcacf987a Cleanup: iterator macros 2018-03-09 11:07:15 +01:00
d1658af025 Merge branch 'blender2.8' into greasepencil-object 2018-03-09 10:53:02 +01:00
6fe83d88b9 Enable Settings by default in predefined brushes 2018-03-09 10:31:56 +01:00
052105b72f Reorganize Stroke panel grouping Settings 2018-03-09 10:29:03 +01:00
b74e90656e Reorganize Brush parameters panel
As we have a lot of options, the panel required a reorganization and clarify what parameters affect after the stroke is created.

Also added options to enable/disable effects like smooth without changing the values.
2018-03-08 19:50:24 +01:00
0dc8adbbab Cleanup smooth code and add one step more
It's better add a loop instead to repeat function call. This is cleaner and we can add more steps if required.
2018-03-08 16:01:58 +01:00
dd9855ed50 Colorpicker must be only in active window
When there are multiwindows, the color picker only must work in the region that originated the operator.
2018-03-08 11:02:59 +01:00
a2a4608a3d WIP: Make active smooth for 2 last points
The smooth now works with the last two points, but for oldest (p-2), uses a reduction factor to avoid strong changes.

This commit is part of the experimental smooth test.
2018-03-08 10:00:53 +01:00
a5e881c9fd Merge branch 'blender2.8' into greasepencil-object 2018-03-08 09:36:57 +01:00
bc99d6246c Missing in previous active smooth commit
The parameter must be used when call smooth function.

Fix error in values too.
2018-03-07 19:10:40 +01:00
ff5eba33ae Minor tweaks to input samples function
Now, the thickness is reduced at different levels depending of samples. The values have been obtained by experimentation.
2018-03-07 18:10:44 +01:00
9e23f80d82 WIP: Smooth while drawing stroke
Initial implementation of active smooth while drawing.

The UI parameter is experimental, so maybe in the future is removed/replaced.
2018-03-07 17:44:41 +01:00
7cc8d31f4c Remove unused affect_pressure parameter in smooth
This parameter was defined but internally was never used. The reason to disable this was that after testing, smooth the pressure got weird autistics results.
2018-03-07 11:06:05 +01:00
1b4ee92652 Chnage overlap factor for Dots to 0.5
The value used before was affected by a bug in point fragment shader. After fixing this bug, the right value here is 0.5 not 0.3.
2018-03-07 10:50:25 +01:00
ef80c41fb9 Make Dots mode thickness equal to Line mode
The dots was using half of thickness and when change the mode to line, the line was thicker.

Now, both thickness are equal.
2018-03-07 09:44:19 +01:00
d8689a421a Merge branch 'blender2.8' into greasepencil-object 2018-03-07 08:23:21 +01:00
40b1caae8f Merge branch 'blender2.8' into greasepencil-object 2018-03-06 19:15:23 +01:00
6fa4ac542d WIP: Integrate Cycles render
This is the first try to integrate the Cycles render with Grease Pencil.

Eevee uses its own call and don't need all this stuff because reuse all Eevee initialization code.
2018-03-06 19:14:04 +01:00
2ac968c167 Merge branch 'blender2.8' into greasepencil-object 2018-03-06 15:45:12 +01:00
6901b7294e Merge branch 'blender2.8' into greasepencil-object 2018-03-05 15:52:40 +01:00
7d9427aa77 Prepare eraser icon to use different images
The code is ready to change the icon for each type of eraser, but as it's not decided yet, we keep the same image in all of them while we decide new design.
2018-03-05 15:51:53 +01:00
3c28f6f727 Move mode type check before set mode
The mode must be verified for this object type before apply new mode.
2018-03-04 16:13:50 +01:00
1010b75aaf More changes in object mode switch
The outliner does not need special code.

Mode change still need more work, because in some situations, still the old mode remains activated.
2018-03-04 13:52:03 +01:00
7c466e1699 UI: Move brush mode to separated panel
This option has been moved to a separated panel because   is too disruptive to have in the main brush panel.

Maybe in the future must be moved to new location, but we put here while we found a better place.
2018-03-03 16:52:12 +01:00
629a5dfb42 UI: Change Pin icon location 2018-03-03 16:18:18 +01:00
d6a25d6262 Fix error using different eraser modes
If the bursh was eraser, the brush was not using the eraser mode.
2018-03-03 16:08:09 +01:00
abbcf1172f UI: Define pin icon for default eraser
Using pin button keep UI consistency better than a checkbox.
2018-03-03 11:38:16 +01:00
34296ab1d8 Merge branch 'blender2.8' into greasepencil-object 2018-03-03 10:55:08 +01:00
9321612879 Avoid drawing with Eraser brush
If the current brush is eraser and try to draw, cancel the operator.

This could be activated with the D key and must be forbidden.
2018-03-03 10:51:55 +01:00
16e0f2fa86 Implement brush eraser quick switch
This eraser switch works very similar to smooth sculpt brush in object sculpt mode.

When the user press Ctrl, the current drawing brush is replaced by the default eraser brush while hold the key.

After release the override key, the brush back to the drawing brush.
2018-03-03 10:39:33 +01:00
cc93479e3b UI: Hide appeareance panel for Eraser brush 2018-03-03 10:17:31 +01:00
c691ab8c79 Create a full set of eraser brushes
Create Soft, Hard and Stroke eraser brushes.
2018-03-03 10:12:15 +01:00
d1d5c99d12 Add new property Default Eraser
This property will be used when the eraser is enabled using fast switch key while drawing with other type of brush.
2018-03-03 00:07:16 +01:00
a2f8d2eb28 Merge branch 'blender2.8' into greasepencil-object 2018-03-02 23:24:25 +01:00
68683f2d4a Add new Eraser modes to UI panel
Now there are 3 types of Eraser in UI panel:

Soft: Need several passes to clean stroke.
Hard: One pass, clean points.
Stroke: Clean all stroke when touch any point.

This modes were available before using modifier keys, but it was not easy to discover.
2018-03-02 23:19:40 +01:00
4a7d969702 Cleanup: Move eraser brush draw to function and avoid duplicated code 2018-03-02 21:13:06 +01:00
9387647ee0 Fix problem with Eraser cursor size
The problem was the internal red area was not using the same size of the external lines.
2018-03-02 20:56:41 +01:00
7a0ee16f25 Change Eraser brush to use brush radius not global value
The old configuration uses a global user prefs value, but now must be the brush size.

Still need to fix the problem when resize size of the brush.
2018-03-02 20:15:51 +01:00
3058310638 Enable right cursor for Erase brush
The cursor must show that you are using the eraser
2018-03-02 20:04:47 +01:00
32c4bc3417 WIP: New Eraser brush
This new brush is equal to the old eraser, but it makes the interface more consistent.

Still need more work to adapt all eraser features, limit other actions not related to eraser and brush switching.
2018-03-02 19:30:39 +01:00
4a2cb1937c Cleanup previous commit
Make more compact the code
2018-03-02 16:57:15 +01:00
5b07881c52 Hide Draw cursor when Eraser is enabled
If the eraser is enabled, the little color dot used as cursor for drawing must be hidden and replaced by dash line circle cursor only.
2018-03-02 16:53:37 +01:00
90b8960bf6 Remove duplicate line
This line had to be removed in a previous commit.
2018-03-02 16:41:00 +01:00
a8818d53a9 Merge branch 'blender2.8' into greasepencil-object 2018-03-02 16:00:05 +01:00
a73d902b02 Fix again grease pencil modes after merge 2018-03-02 15:53:39 +01:00
40c13d2a7a Small change to capture algorithm 2018-03-02 14:15:09 +01:00
c652eb0a45 Adapt code after merge
THe code was moved to new module
2018-03-02 11:39:12 +01:00
b98df2831c Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/object/object_edit.c
	source/blender/editors/object/object_select.c
2018-03-02 11:29:28 +01:00
5855c23a64 Tweak missing event algorithm for extreme zoom
Due int number limitations, when the zoom factor is extreme, the points are captured with gaps. This change try to minimize this effect, but it's impossible to solve this issue completely.

The problem is the mouse position is always defined by a pair of int number, so the maximum precision is limited to that, so when project the point in 3D space, there are small precission erros.
2018-03-02 11:26:04 +01:00
e8ba703f80 Cleanup: macro's w/ an _END need a matching _BEGIN 2018-03-01 19:02:39 +01:00
31df0f7508 Merge branch 'blender2.8' into greasepencil-object 2018-03-01 18:44:04 +01:00
ccf99ea3b4 Cleanup more compiler warnings 2018-03-01 18:43:36 +01:00
bd769050cd Cleanup: Silent multiple compiler warnings 2018-03-01 17:30:25 +01:00
2d0babbbc7 Cleanup variable initialization 2018-03-01 16:47:34 +01:00
893694ffc0 Cleanup comment mistake 2018-03-01 16:31:29 +01:00
ca0ecfc234 Fast mouse event capture afected by zoom factor
Before, the number of points was not equal at different zoom levels.

To get this work, the pixel size is calculated and the distance is relative to 30% of the brush thickness multiplied by the number of samples.

The number of samples has been reduced too, because the new method doesn't need big values.
2018-03-01 16:30:25 +01:00
Dalai Felinto
c5950874b2 Fix blenderplayer (tm) 2018-03-01 10:50:18 -03:00
a474726eb2 Merge branch 'blender2.8' into greasepencil-object 2018-03-01 11:32:00 +01:00
a057e55981 Fix grease pencil mode problems after merge 2018-02-28 20:03:12 +01:00
b45349dee1 More merge fixes 2018-02-28 19:05:10 +01:00
ee93194f9c Fix missing line after merge 2018-02-28 18:34:04 +01:00
073d6d07e4 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/scene.c
	source/blender/editors/object/object_select.c
2018-02-28 18:28:38 +01:00
65b450d9cd Add new Brush Eraser icon
This is part of the new eraser brush.

Design by Matias Mendiola
2018-02-28 18:22:49 +01:00
55772c2c67 Fix error in Fill due pixscale
I missed to change this pixel factor
2018-02-28 17:54:39 +01:00
c6ef2f587e Replace brush type by enum
This is the first step to add eraser brush
2018-02-28 17:21:43 +01:00
6f5c47ea3e Change icon for Fill Brush
After some reviews by Pablo Vazquez and Matias Mendiola, they decided to change color to keep UI icons consistency.
2018-02-28 17:20:49 +01:00
611337cad5 Fix refresh error when change mode to Boxes
I had forgotten to pass the parameter to shader.
2018-02-28 14:23:16 +01:00
aa342de7c0 Cleanup: Remove typo error
Thanks to Nikola Ivanov for catch the error.
2018-02-28 14:18:46 +01:00
edb1c5c10b Cleanup: Make function static 2018-02-28 10:38:15 +01:00
5a37f69467 New Draw mode "Boxes"
This draw rectangles instead of Dots and allow new artistic effects.
2018-02-28 10:28:24 +01:00
ee71026222 Fixes after merge 2018-02-28 10:14:05 +01:00
811a6c298c Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/draw/intern/DRW_render.h
        source/blender/draw/intern/draw_manager.c
2018-02-28 10:05:27 +01:00
019365698a More tweaks to samples algorithm 2018-02-27 17:12:56 +01:00
85dbec66e2 Merge branch 'blender2.8' into greasepencil-object 2018-02-27 17:00:40 +01:00
3b8fa28855 Minor changes to Input Samples algorithm
Now the number of slices is rounded using a ceiling value.
2018-02-27 16:59:28 +01:00
21a09cbdcc Merge branch 'blender2.8' into greasepencil-object 2018-02-27 12:05:47 +01:00
6ba26e6ab5 Fix infinite loop if color is missing
Usually, this never happens, but if any color is missing, needed to add to hash to avoid the creation of duplicate materials.
2018-02-27 11:47:03 +01:00
98d1b46417 Fix wrong interpolation for fake events
The distribution was not even and it was slightly moved because it was not necessary to copy point between segments.
2018-02-27 09:53:29 +01:00
0336d60151 Merge branch 'blender2.8' into greasepencil-object 2018-02-26 22:11:02 +01:00
1c045f64d0 Merge branch 'blender2.8' into greasepencil-object 2018-02-26 19:37:08 +01:00
c1c1b52556 Invert Input Samples value
In order to keep UI consistency, the value now it's inverted. Bigger values, means more precission.

A value of Zero means, no additional sampling.
2018-02-26 19:34:52 +01:00
a636f3fbd1 Generate missing mouse event
When the artist moves very fast the mouse, there are event that are not captured due hardware limitations, so need to interpolate the position and generate the missing control points in the stroke.
2018-02-26 18:38:03 +01:00
0014d0959c Fix Monkey stroke scale
This was missing when Pixfactor was changed
2018-02-26 14:54:18 +01:00
841745a33b Use Onion colors for Textured strokes
Before, if the stroke was textured, the onion frames were not using the assigned for prev and next frames in the onion skin panel.
2018-02-25 19:24:59 +01:00
ecad07aeae Merge branch 'blender2.8' into greasepencil-object 2018-02-25 17:02:20 +01:00
36efa02db3 Revert "GWN: Fix immediate mode when closing a window."
This reverts commit https://developer.blender.org/rBe7c4a9d1ef76f6edff95ca9f418a65fc42a453dc
2018-02-25 16:54:11 +01:00
1c375729c6 Cleanup: Fix stupid typo error in previous commit 2018-02-25 11:40:40 +01:00
1f19e0fd6c Merge branch 'blender2.8' into greasepencil-object 2018-02-25 11:30:23 +01:00
9dab2a5892 Back removed property and set as deprecated 2018-02-25 11:29:33 +01:00
ab3d9b6e8c Enable Fill for DOTs mode
The fill was disabled for dots mode and only used in line mode. Now, as Dots can be used to draw, the fill is required.
2018-02-25 11:16:45 +01:00
debf38840b Replace Use Dots for a Enum menu
Instead to define a checkbox, now the dots is a mode.
2018-02-24 21:58:28 +01:00
8198668228 Apply strength factor to textured strokes 2018-02-24 20:01:14 +01:00
208b018edf Adapt render code after merge
Again, the function parameter list has changed in Draw Manager and the gpencil code need changes.
2018-02-24 18:28:19 +01:00
e5220e2f7e Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/draw/intern/draw_manager.c
2018-02-24 18:02:36 +01:00
803f80c673 Add UV rotation option to Smooth and Noise modifiers
To be consistent, the modifiers must work with UV rotation as the sculpt brushes do.
2018-02-24 18:00:07 +01:00
71f0e59b2e Apply Smooth and Random sculpt to UV rotation
Now it's possible apply the sculpt to the rotation of the UV texture.
2018-02-23 23:55:27 +01:00
4f504f2780 Update strokes UV when change UV factor in color
Recalc UV data for any stroke that is using the color.
2018-02-23 23:33:57 +01:00
59bd7c34ba UI: Rename Pixel Factor to Scale
From artist point of view it's more clear the new name. Pixel factor can be technically correct, but it's look weird.
2018-02-23 17:08:50 +01:00
3d479a5cc5 Cleanup extra empty line
This line was introduced in previous commit by error.
2018-02-23 10:49:52 +01:00
89316bc784 Merge branch 'blender2.8' into greasepencil-object 2018-02-23 10:39:13 +01:00
45f94cb02a Rescale Pixel Factor to to something more manageable
The old scale between 30 and 10000 was not user friendly and it was inverted (bigger value got smaller stroke)

Now the default scale is 1.0 and bigger values get thickerr strokes.
2018-02-23 10:37:01 +01:00
8299296ed1 Cleaunp previous commit
This avoid pass one matrix
2018-02-22 18:52:29 +01:00
42f2ec08d2 Fix error in VFX Pixelate modifier
The location must be multiplied by ModelViewProjection matrix.
2018-02-22 18:35:09 +01:00
055123bd58 Depsgraph: Wrap all arguments for modifiers relations update into a struct 2018-02-22 16:03:34 +01:00
3bb51bb162 Merge branch 'blender2.8' into greasepencil-object 2018-02-22 15:48:25 +01:00
b2bde994e9 Merge branch 'blender2.8' into greasepencil-object 2018-02-22 12:59:20 +01:00
f175657591 Rename pixel parameter
The name pixel can be confusing. It's better use UV factor because pixel concept is something intern.
2018-02-22 10:03:37 +01:00
b9ee2fb77c MSVC 2013 Compile Fix/Workaround for "static thread_local" vars
Apparently MSVC 2013 has trouble with stuff that's been declared
"static thread_local" (and/or maybe even the "thread_local" keyword).

https://stackoverflow.com/questions/29399494/what-is-the-current-state-of-support-for-thread-local-across-platforms
2018-02-22 19:22:50 +13:00
d9d57fe8f5 Merge branch 'blender2.8' into greasepencil-object 2018-02-22 19:10:40 +13:00
280fe8f91c Merge branch 'blender2.8' into greasepencil-object 2018-02-21 20:28:50 +01:00
e9727767a2 Calculate UVs while drawing
Now the UV while drawing is calculated using same logic used in final UV.

There will be differences between drawing and final due simplify and smooth postprocessing, but the look is more similar now.
2018-02-21 19:59:18 +01:00
f3370eb2bb Redo UV calculation using color factor
Now the Pixel size ratio is determined by a parameter of the color and not by view pixelsize.

This solves various problems and allow the user define dfifferent effects.

NOTE: Still pending to use the same logic while draw.
2018-02-21 19:32:17 +01:00
c4c60b3f94 Cleanup: Rename function 2018-02-21 16:21:42 +01:00
ca6ee0ef72 Use UV randomness UV rotation parameter 2018-02-21 11:09:27 +01:00
11910fdb50 New UI parameter to define UV rotation randomness 2018-02-21 11:04:14 +01:00
a12b8dbc40 Merge branch 'blender2.8' into greasepencil-object 2018-02-21 10:39:13 +01:00
e07aa09bd2 Fix pattern for Fill stroke 2018-02-21 09:35:07 +01:00
36b2a8fb6c Fix pattern mode for strokes
Now use the alpha channel
2018-02-21 09:30:09 +01:00
23f5f28a15 Adapt grease pencil render code after last merge 2018-02-20 17:01:49 +01:00
f7dad2b0f8 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/draw/intern/draw_manager.c
2018-02-20 16:13:05 +01:00
0b03ef7000 Use same rotation factor in both sides 2018-02-20 16:09:24 +01:00
b0744c7855 Use fix UVs for solid stroke
If the stroke is solid, use fixed uvs to avoid any possible gap.
2018-02-20 16:06:36 +01:00
30096e1e18 Extract Render code to separated function 2018-02-20 10:25:30 +01:00
3a5f46bd7f Fix error in UV rotation when subdivide 2018-02-20 10:15:58 +01:00
44d3c80a74 WIP: Add UV rotation for Dot texture
Now the ramdom is fixed. Need parameters to adjust.
2018-02-20 10:07:15 +01:00
978f50a0c8 Add ToDo comment for fixing later 2018-02-19 19:28:23 +01:00
2c2ff7826a Missing in previous commit (encaps for solid only) 2018-02-19 19:25:17 +01:00
bc30fbd832 Use stroke encaps only for solid mode
If use endcaps in texture mode, sometimes the texture is not correct if the type of texture used is not defined in a way that can be doubled.
2018-02-19 19:08:45 +01:00
32a1cba504 Calc UV data while painting 2018-02-19 19:07:06 +01:00
3e468e5556 WIP: Improved use of UV along the path and speedup
Now the texture is calculated using the pixelsize along the stroke.

Added a precalculation of fill and Uvs caches in order to avoid recalculation on frame change. This makes first play a little more slow (few miliseconds), but the next time the frame is used, all cache data is precalculated and the overall FPS is better when use fill strokes.
2018-02-19 17:54:00 +01:00
d674891da3 Add new UV data parameters to shaders
Add new parameters to transfer UV data information in order to texture the stroke along the path.

WIP: Still not working
2018-02-19 11:01:21 +01:00
63d331b5de Calc UV factor along the stroke
This data will be used in texture strokes
2018-02-18 18:19:40 +01:00
f0419a4a2a New point fields for UV data
These fields will be used to save information about texture coordinates of the point.
2018-02-18 17:11:53 +01:00
b767d3ac08 Fix compiler warnings (extra parameter)
This was missing in previous commits
2018-02-18 16:52:14 +01:00
388eeebdfa Rename include after merge 2018-02-18 16:50:42 +01:00
7c3be5bfb5 Merge branch 'blender2.8' into greasepencil-object 2018-02-18 16:38:09 +01:00
94daab8ba0 Fix tone mapping error in vfx
The tone mapping parameter for shader was missing.
2018-02-18 12:23:47 +01:00
7245f72b8a Remove old tonemapping code
This code was slower than current fragment code.
2018-02-18 12:16:55 +01:00
14533f446c Change tonemapping to shader
This makes faster the tonemapping and fix texture issues.

Still pending clear old colorspace code.
2018-02-18 12:04:43 +01:00
57279f84f9 Merge branch 'blender2.8' into greasepencil-object 2018-02-17 15:56:07 +01:00
36eef07e3b Fix UV scale for stroke endcaps 2018-02-16 19:06:33 +01:00
41b962f19e Fix UV coordinates for strokes 2018-02-16 18:42:07 +01:00
b0455220bf Use DRW function to check opengl render
Instead of check global value, use draw manager function to verify if it's running an opengl render.
2018-02-16 17:08:44 +01:00
ad50e0f7ca Merge branch 'blender2.8' into greasepencil-object 2018-02-16 16:53:38 +01:00
ee7134fdd3 Merge branch 'blender2.8' into greasepencil-object 2018-02-16 10:35:28 +01:00
3a0febbb75 Add warning message to enable passes
This message would be added to the main operator, or maybe if grease pencil is present, enable these passes by default.
2018-02-16 10:32:13 +01:00
f2492ab712 Cleanup: Remove unused file 2018-02-16 10:27:43 +01:00
ed6d64320e UI: Hide grease pencil paper if not gpencil object 2018-02-15 19:57:35 +01:00
1534ffe42c Fix pixelate for negative values
If the object was in negative location, the draw got full opaque.
2018-02-15 18:52:10 +01:00
db171b93f0 Fix error for render onion skin
The flag was not working as expected in renders
2018-02-15 17:02:20 +01:00
78e9821df7 Rename function macro after merge 2018-02-15 16:10:25 +01:00
f51aa64db3 Merge branch 'blender2.8' into greasepencil-object 2018-02-15 16:01:43 +01:00
adcdd047e1 Fix merge error
The line must be after grease pencil code
2018-02-15 10:32:45 +01:00
a556f170f7 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/draw/intern/draw_manager.c
2018-02-15 09:31:51 +01:00
d284633e80 Merge branch 'blender2.8' into greasepencil-object 2018-02-14 17:01:30 +01:00
0ea09fb553 Fix merge errors 2018-02-14 10:45:38 +01:00
79a18e1550 Merge branch 'blender2.8' into greasepencil-object 2018-02-14 10:35:21 +01:00
535277144a Fix merge compiler error 2018-02-13 17:51:26 +01:00
27ce492edb Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/space_outliner/outliner_select.c
	source/blender/editors/space_view3d/view3d_draw_legacy.c
	source/blender/makesrna/intern/rna_sculpt_paint.c
2018-02-13 17:38:38 +01:00
00c6e57faa Remove duplicate line 2018-02-13 17:34:18 +01:00
86cb87c0fa Chnages to use OCIO 2018-02-13 13:22:34 +01:00
0453d2fe39 Cleanup Style
Changed by error in previous commit
2018-02-13 12:59:42 +01:00
a0d6bc6af0 Fix undo modes and mode changes
Now the Ctrl+Z does not undo the mode.
2018-02-13 11:48:31 +01:00
8c5f2e1bbc Chnage lasso eraser keymap to Ctrl+Alt 2018-02-13 09:11:36 +01:00
3d55a721bc Refresh cache if render to refresh viewport 2018-02-12 20:54:49 +01:00
be9f43e57d Cleanup: Use macro 2018-02-12 19:31:59 +01:00
a8d4b0154d Create multiframe buffer only if multisample enabled 2018-02-12 17:14:31 +01:00
acd903e16e Cleanup style 2018-02-12 17:01:00 +01:00
58d293dfb3 Merge branch 'blender2.8' into greasepencil-object 2018-02-12 16:40:16 +01:00
11cbbf2855 Cleanup unused code 2018-02-12 16:35:53 +01:00
e0ea483bd7 First try to fix grease pencil object modes
After last merge of 2.8 the object modes was not working. Now we back to previous situation where the user can switch between objects and handle different modes.
2018-02-12 16:30:22 +01:00
74032304c0 Fix multisample error in render
It was checking the wrong default_fb instead of multisample_fb, so it was never created.
2018-02-12 11:21:55 +01:00
5fb9d70821 Merge branch 'blender2.8' into greasepencil-object 2018-02-12 09:15:34 +01:00
33654d77c2 Remove select operator hack
This hack was used when all modes shared the same keymaps, but now it's not necessary.
2018-02-12 09:10:52 +01:00
a18f1656c1 Fix keymap error 2018-02-11 16:58:26 +01:00
f990cf29c1 Back Lasso and Border eraser
These options were removed by error.

Due keymap conflicts, the new keymaps are:

Lasso: LMB + Ctrl + Shift
Border: B
2018-02-11 16:31:29 +01:00
6b924d1b44 Fix error when init drawing
The object is already activated, so if reactivate, the mode is missing.
2018-02-11 12:36:20 +01:00
8b2c3704db Merge branch 'blender2.8' into greasepencil-object 2018-02-11 12:07:56 +01:00
753e83e608 UI: Back Brush appearance panel and fix active mode
Back the brush appearance panel to separated tab and fix error introduced in previous commit because workspace hasn't active_object_mode
2018-02-11 11:34:48 +01:00
40cb8bf45f Change color picker keymap to P key
Replace old F6 keymap to avoid conflicts.
2018-02-11 11:23:23 +01:00
377ff0fee6 Back eraser to Ctrl keymap
Soft Eraser: LMB + Ctrl
Hard Eraser: LMB + Ctrl + Shift
Stroke Eraser: LMB + Ctrl + Alt

Straight Line: LMB + Alt
Polyline: LMB + Shift + Alt
2018-02-11 11:17:43 +01:00
6bdd1ee77b Cleanup: Rename property to avoid negative names 2018-02-11 10:49:59 +01:00
a596d5df05 Fix error in OpenGL render
As F12 and OpenGL are detected as render mode, the pixel size was not correct.

I have added a check to verify if it is a real F12 render or it's a OpenGL.

Maybe this check must be removed if the OpenGL render operator is deprecated by a new system, but we need to keep the verification until them.
2018-02-10 20:04:24 +01:00
ca550d2073 Create multisample buffer for render
As render does not create default buffers by default, the render needs to create multisample default buffer in order to use antialiasing.
2018-02-10 17:58:25 +01:00
eb54e97784 Fix render artifacts
When 3D object was in front there was some noise.
2018-02-10 17:16:29 +01:00
d7c3a09aac Fix render error when previous result is NULL 2018-02-10 13:12:28 +01:00
9ead9396d8 Fix error when sky is transparent
If the sky is transprarent the zdepth value is not valid to check, so it's better don't copy the pixels.
2018-02-10 12:56:52 +01:00
5d4b766a49 Interpolate render result for transparent colors
There is still some problems with AA.
2018-02-10 12:37:36 +01:00
294ff5ec16 Cleanup: Rename variables 2018-02-10 11:28:48 +01:00
692704543b Check exist grease pencil objects before render
If the scene has not grease pencil objects, it's not required to call grease pencil rendr functions.
2018-02-10 11:26:40 +01:00
1e7ed3d85c Missed in previous commit 2018-02-09 20:10:41 +01:00
ee6a257cab WIP: Render mixing GP and Eevee or Cycles
Still there are problems with AA, but now it's possible to get a composed result with Cycle/Eevee and Grease Pencil.
2018-02-09 20:05:26 +01:00
65f62b70c2 Temp fix for object mode
The function ED_object_base_activate() was calling again the mode set and undo the mode change.

Do we need this function? Really the object is already the active one.
2018-02-09 18:11:06 +01:00
a8fa2d9321 Fix infinite loop in mode set
The mode set entered in an infinite loop
2018-02-09 17:50:11 +01:00
f9d6b3565d Fix compiler error after merge 2018-02-09 17:09:12 +01:00
c5dc05b038 Fix on previous commit to use active_object
Need to use active_object, not object
2018-02-09 17:07:16 +01:00
50ab5db1c3 Fix python object mode changes
After last changes, need to use workspace mode
2018-02-09 17:03:40 +01:00
2f6269ca74 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenkernel/intern/paint.c
2018-02-09 16:39:17 +01:00
507e3e12b6 Merge branch 'blender2.8' into greasepencil-object 2018-02-09 10:27:55 +01:00
3df45f7f97 Cleanup: Rename function to keep render grouped
Keep all render functions name with _render prefix.
2018-02-09 10:24:59 +01:00
840612bd9d More compile Fixes for object->mode refactor
TODO: I've come across some rather fishy-looking code in a few places
      that will need more careful review later

* gpencil-select.c - 1181
* object_edit.c - 1596
* view3d_select.c - 1626
* undo.c - 230
2018-02-09 19:32:39 +13:00
3fb46529a5 Cleanup: Rename variables 2018-02-08 16:31:39 +01:00
9e2faaf0f5 WIP: Initial commit to use zdepth render data
Still not tested (branch is broken), but this commit is to keep log of the changes.
2018-02-08 16:08:44 +01:00
71b3495a08 Compile Fix: ob->mode lookups 2018-02-09 03:25:49 +13:00
99e8154098 Compile Fix: Fixes for the mode toggle operators
* Changed ob->mode / ob->restore_mode to
  workspace->object_mode_restore / workspace->object_mode

* BKE_workspace_object_mode_set() got removed.
  From the changes in rna_wm.c in (345c6298e9)
  it looks like this is all we still need to do now.
  However, this will need to be reviewed more carefully later.
  For now, this will do!
2018-02-09 03:17:07 +13:00
781cf304a4 Compile Fix: Use proper flag for tagging temporary datablocks created for drawing only 2018-02-09 00:20:04 +13:00
ffc77a4e67 Merge branch 'blender2.8' into greasepencil-object 2018-02-08 23:47:09 +13:00
46c5fe3d8c WIP: Temporary hack to get something showing up when using GP in 2D editors for annotations
Temporary restoration of init_palettes() for the non-2D case. Ultimately,
this will not remain, but we need to retain support for this until the
drawing code is sorted out.
2018-02-08 23:43:42 +13:00
51a60c9990 Fix render pixel size
The calculation must be equal to the viewport, because using the camera pixel size, the result is not correct.
2018-02-08 11:07:42 +01:00
225f174970 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/space_outliner/outliner_draw.c
2018-02-08 16:16:58 +13:00
e89ac16ac0 Fix: Data-Blocks view in Outliner no longer displayed property values, making it semi-useless
Partially revert efe1af3d11

The offending commit over-zealously removed the datablocks viewer case
as well, when only the condition needed to be modified.
2018-02-08 16:13:55 +13:00
106c212b1a Cleanup - Use builtin function for clarity 2018-02-08 16:09:15 +13:00
5fb42459e6 Fix crashes trying to draw GP strokes in 2D editors
Currently nothing appears when you try to draw still, but at least it
won't crash.
2018-02-08 15:46:07 +13:00
27c63de39c Cleanup
* Reduce number of extra/excess layout.row() elements with a single item
* Simplify logic (redundant check)
2018-02-08 14:54:07 +13:00
ecb4d23df9 Try to fix pixsize in render mode
Still the pixsize is not working becaus ethe values are not valid.
2018-02-07 19:41:11 +01:00
f1dfddd723 WIP: More work on render
Now get a result, but still the stroke is missing and replace any other render image.
2018-02-07 18:18:56 +01:00
690f118cfb WIP: Initial steps to define render to image functions
This commit is to put in place all components of the render, but still not working and only enabled in debug mode.
2018-02-07 16:58:28 +01:00
316a356c54 Calculate zdepth relative to camera plane if rv3d is null
If the viewport is not available, RegionView3D is null, so to calculate the z-depth must use the camera plane.

This is a preliminary step to integrate render (F12)
2018-02-07 16:32:14 +01:00
f828777fbe Disable grease pencil paper in render mode
This is a preliminary step to integrate render (F12)
2018-02-07 14:12:32 +01:00
0bcde767a9 Merge branch 'blender2.8' into greasepencil-object 2018-02-07 11:07:31 +01:00
1e6e4b326d Cleanup: Reduce number of passes using pointers
Instead to define different passes for mixing final result, now reuse the passes and use pointers to replace input textures.
2018-02-07 11:04:44 +01:00
f4051f05cb Cleanup style 2018-02-07 10:31:12 +01:00
5d274778f5 Fix: Don't show "Brush Appearance" panel in Edit Mode 2018-02-07 21:00:56 +13:00
f3d894db65 GP UI: WIP Attempt to cleanup some weird alignment/nesting/spacing issues
It's unclear to my why all these fields seemed to be individually wrapped
in both a row and column layout, but with "align=True" enabled, causing
the widgets to be oddly separated in the UI
2018-02-07 15:58:09 +13:00
bb30a721b4 GP Eraser Panel: Expose button to activate eraser
It's currently impossible to activate the eraser in the 3D view otherwise
if you're using a mouse (unlikely for most serious 2D artists, but possible
for non-sculpting modellers/animators) or if your tablet doesn't have an
eraser end (IIRC some non-Wacom styluses may have this limitation)

Also noted that we should also expose the hard/soft mode, and/or strength
settings here too (as opposed to having these hardcoded and/or mapped to
hardcoded modifier keys only)
2018-02-07 15:28:33 +13:00
6c13ef9f94 GP UI - 2D/3D Split: Move all 3D toolbar only panel code to space_view3d_toolbar.py
* All toolbar panels that are only used in the 3D view have now been
  moved out of properties_gpencil_common.py, as they are *only* used
  in that editor.

* Sculpt, Edit, and Eraser panel definiitions remain in the common file
  for now, as it's still possible for these to be used in other editors
  (at least in theory - there may be some new limitations I haven't found yet)
2018-02-07 15:14:00 +13:00
c8844ef24b GP UI - 2D/3D Split: Split out the "Create Shapes" and "DrawingToolsPanel" into separate classes
The 3D/GP Object only used part of the old "DrawingToolsPanel" to
draw the "Shapes" panel, going so far as to use an empty label +
custom draw header function to dynamically change the label.

This commit properly fixes the code here by separating out the code for
the two use cases:
* The GP object case is now handled by a dedicated "GreasePencilCreateShapesPanel"
  that only does the "Shapes" stuff
* I've reverted the other case back to the master version, as this is more
  suitable for use by all the other 2D editors
2018-02-07 14:36:10 +13:00
17fa87aa5a Clean Boundary Fill: Clarify Labels/Tooltips 2018-02-07 14:18:11 +13:00
3ec422182f GP "Strokes Edit" Panel: Consolidate a few items in preparation for restoration of 2D GPencil (WIP)
The groupings here are not final, and can still be adjusted/scrapped.

1) Used "operator_menu_enum"'s in place of listing out all the modes of
   certain operators with multiple modes. This brings those operators more
   in line with the other ops here (and in other parts).

2) Fixed the code to not show 3D only operators if this panel gets used
   anywhere else.
2018-02-07 14:17:47 +13:00
f78059a4f0 Cleanup: Style fixes 2018-02-07 13:52:31 +13:00
70a41a5200 Cleanup: Move modal operator draw callbacks out of ED_gpencil.h
Turns out that these were only actually used from within the gpencil
module (i.e. they were defined in drawgpencil.c, and called from the
gpencil_<opname>.c files), so it's not even necessary to export these
function prototypes in the ED_gpencil.h header.
2018-02-07 13:09:19 +13:00
a4b72a41a4 Cleanup: Remove color picker defines from headers
There's no need for these defines to be in any headers, as this operator
is entirely self-contained in its own file now.
2018-02-07 12:33:28 +13:00
96ba61cf21 Merge branch 'blender2.8' into greasepencil-object 2018-02-06 17:23:18 +01:00
c0cef0a393 Remove limitation of fill only colors
Now, when a fill brush is selected, the color picker shows all colors, not only fill colors. This makes the palette more consistent.
2018-02-06 17:17:09 +01:00
d56a035f7d Fix enum after merge
The code has been moved to new header file, so new definitions were missed.
2018-02-06 16:30:04 +01:00
c1401c7966 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/object/object_modifier.c
	source/blender/editors/space_outliner/outliner_tree.c
	source/blender/makesdna/DNA_object_types.h
2018-02-06 16:18:59 +01:00
36b64064f1 GP Toolbar UI: Move the "Eraser" and "Brush Appearance" panels to the Tools tab in Draw Mode
It was awkward having these in the "Options" tab, where they were
likely to get missed. This change will perhaps make more sense
after some of my other upcoming changes here.
2018-02-07 03:05:03 +13:00
f4f230381d Cleanup: Simplify various bits of the GP Color Picker code
* Removed the redundant init() wrapper
* Got the "focus" text highlight working again (missed from previous commit)
* Removed some unused vars
* Clarified reason why poll fails
2018-02-07 03:05:02 +13:00
2bc6c2de06 Fix: GP Color Picker text positioning/sizing was using an absolute pixel size for an offset
This would break when changing the DPI settings
2018-02-07 03:05:02 +13:00
c9c2e888e2 GP Color Picker: Highlight the color under the mouse
Previously, the color picker provided no feedback on which
color under the mouse would get applied when clicking.
It also wasn't that clear what the current active color
was.

This commit fixes this, making the UI feel more like a
standard Blender menu/popup, and less like a glitchy
non-interactive graphic, by drawing a highlight rect
behind the item currently under the mouse. By default,
the current/active color will be highlighted before
the mouse enters the panel.
2018-02-07 03:05:01 +13:00
71c423f6b3 GP Color Picker: Shrink thickness of outlines around color swatches
Now it looks less cartoonish, and more in line with other UI widgets
2018-02-07 03:05:00 +13:00
6861ea7cdd Cleanup: Use BLI_rect functions instead of inlining boundbox range checks 2018-02-07 03:05:00 +13:00
2637686bd1 Fix error of render when select object not GP
The problem was the cache was not set to dirty if the active object was not a GP object.
2018-02-05 18:03:47 +01:00
90387cfa0f Merge branch 'blender2.8' into greasepencil-object 2018-02-05 16:12:37 +01:00
f276b08714 Convert colors to linear for OpenGL render
This is a workaround to convert the colors to linear space instead of sRGB for opengl render.

This can change in the future, but now this fix is required in order to produce the renders of Hero open movie.
2018-02-04 20:05:45 +01:00
e59a9210fd Merge branch 'blender2.8' into greasepencil-object 2018-02-04 13:42:19 +01:00
cb72b906d8 Merge branch 'blender2.8' into greasepencil-object 2018-02-03 16:26:14 +01:00
49cf21487a Replace BKE_object_is_visible by context function 2018-02-03 12:37:22 +01:00
18e4a28665 Add missing initialization values to DrawEngineType
Some new callback variables have been added to the DrawEngineType struct. These values are not used, but need to be initializated properly with NULL.
2018-02-03 11:10:54 +01:00
ef3a03c810 Improve Stabilizer tooltip 2018-02-03 11:03:12 +01:00
1c32299a2b Merge branch 'blender2.8' into greasepencil-object 2018-02-03 09:51:14 +01:00
f2d0df82fa Keep selection after Split stroke
When split a section of the stroke is better to keep the selection.
2018-02-02 20:39:32 +01:00
59828ced95 Cleanup: Remove unused variables 2018-02-02 20:15:46 +01:00
bd77846825 Cleanup: Fix comments 2018-02-02 17:48:19 +01:00
20d85e457c Merge branch 'blender2.8' into greasepencil-object 2018-02-02 17:32:17 +01:00
2987202deb Merge branch 'blender2.8' into greasepencil-object 2018-02-02 17:01:38 +01:00
d7a3669304 New Split operator
Split selected points in a new stroke in the same frame. The stroke is not created in the current frame, but in the frame of the original stroke.

Shortcut: V
2018-02-02 16:59:10 +01:00
3586981e8f Cleanup: Remove duplicate operation
It was stupid add and sub the same value
2018-02-02 11:22:34 +01:00
814373f13e Make color picker panel more compact
There was too many space between colors and panel borders.

Also changed the aspect ratio for small number of colors.
2018-02-02 10:49:54 +01:00
19aec0a376 Merge branch 'blender2.8' into greasepencil-object 2018-02-02 10:34:37 +01:00
0cc0b89013 Cleanup: Create function to duplicate stroke to avoid code duplication. 2018-02-02 10:34:04 +01:00
23aa0fdc36 Cleanup: De-duplicate dynamic enum function used for setting GP brush icons
It turned out that there were slight differences between these two
versions (namely, where they searched for the list of active brushes),
but it's not too much of a stretch to use the same code for this with
a few minor tweaks, as per this commit.
2018-02-02 19:43:27 +13:00
ea55e31f27 Cleanup: Remove unused/deprecated dynamic enum stuff 2018-02-02 16:15:41 +13:00
27e3b782e4 New option to separate Points
Added an option to separate selected points and not only whole stroke.

Also some cleanup task as rename vars and reorganize code.
2018-02-01 19:18:05 +01:00
af1c1ff2a1 Add P key shortcut for Separate operator 2018-02-01 18:23:16 +01:00
faaf20c3a2 UI changes for color picker
* Colors have labels, so previews don't need to be as big, GP_BOX_SIZE  set to 32.
* More padding between items, they are too close to each other at the moment GP_BOX_GAP set to 24.
* Round boxes  are  a bit less round to match the rest of the UI 0.2f  (before used 0.4f)
* Cursor should not change to color picker. We are performing an action (selecting an item), not picking UI colors per se.

Thanks Pablo Vazquez for the feedback
2018-02-01 17:11:03 +01:00
0319fd82e4 Merge branch 'blender2.8' into greasepencil-object 2018-02-01 16:31:49 +01:00
cbe20b9a2d Cleanup: Define a shared poll method for edit 3D 2018-02-01 16:22:03 +01:00
e5989702ee New Separate operator
This operator works similar to mesh separate operator, but for grease pencil strokes.

Two options:

a) Selected Strokes
b) Active Layer
2018-02-01 16:22:03 +01:00
dd7e0353c7 Cleanup: Remove unnecessary flags and fix typo 2018-02-01 16:22:03 +01:00
28b9dfeece Move int <-> float 2d vector funcs from GP code to Math Lib
We now have the following two new functions:
* copy_v2fl_v2i(float r[2], const int a[2])  <-- Copies 2D int vector to float vector
* round_v2i_v2fl(int r[2], const float a[2]) <-- Copies 2D float vector to int vector, by rounding the values
2018-02-01 20:38:41 +13:00
e6b8221652 Merge branch 'blender2.8' into greasepencil-object 2018-01-31 10:17:30 +01:00
8115103911 Cleanup: Use standard mathlib functions here, instead of inlined pointer magic/etc. 2018-01-31 18:58:27 +13:00
b05f4c7132 More self-contained fix for previous commit 2018-01-31 18:32:19 +13:00
2e64865c51 Cleanup: Various fixes
* Remove redundant operations (e.g. extra copies of data)

* Remove duplicate functions (e.g. vector copying, for non-floats)
  TODO: We still have copy_v2int_v2float() and copy_v2float_v2int()
        to fix (i.e. rename + move to BLI_math.h)

* Cleanup redundant struct forward defs in headers (including some duplicates)

* Hacky fix for compiler warning in gpencil_colorpick.c (about const vs non-const)
  UI_FSTYLE_WIDGET is const, but UI_text_clip_middle_ex() needs non-const
2018-01-31 18:30:29 +13:00
e1ae00c38b Cleanup: More simple fixes 2018-01-31 17:27:44 +13:00
6701e8348e Cleanup: Style fixes 2018-01-31 17:22:06 +13:00
a99c4c7290 Cleanup: Move ED_gpencil_stroke_minmax() to blenkernel
The rest of the boundbox/minmax code is already there. We might as well
have the function for grabbing this info from a single stroke there too.
2018-01-31 17:06:21 +13:00
bc125b415d Cleanup: Reshuffling order of code in file
In future: Keep related code together, instead of just dumping
it "wherever" (aka at the end of the file, since it's most
convenient right now)

(In the process, I've ended up flagging a few pieces of code
for further investigation. They likely duplicate some code
elsewhere in other modules)
2018-01-31 15:50:04 +13:00
b186698d9b Cleanup: Prefix all exported functions with module prefix 2018-01-31 14:23:04 +13:00
0cd8cdd8d4 Cleanup: Fix mixed use of tab/space whitespace 2018-01-31 14:21:58 +13:00
fdc1a1c06b Cleanup: Move private/internal operator state data out of public header for GPencil module
This commit moves the defines for several modal operators
(Interpolate, Fill, and Add Primitives) out of the editors/gpencil
module's public headerfile ("ED_gpencil.h") into the module's
internal headerfile ("gpencil_intern.h").

We should not be spraying the internal implementation details of
operators in public headers. In this case, these defines weren't
even being used outside of the gpencil module - they were only
put in a header so that drawgpencil.c (which lives in the same
module) could access this data (and even then, I wonder those
callbacks need access to everything).

Note: I couldn't get rid of the ED_numinput.h include in the header
yet, as several of the operators define NumInput members inline.
2018-01-31 14:10:04 +13:00
833afb75ae Fix error in fill stroke thickness
To avoid gaps, the thickness of the internal strokes must be reduced, but the previous code only worked when the factor was different of 0.
2018-01-30 17:45:08 +01:00
2aa5950562 Merge branch 'blender2.8' into greasepencil-object 2018-01-30 17:18:54 +01:00
0f8af3a5ce Rename "lazy Mouse" to "Stabilizer"
Also changed "Radius" to "Distance"

Thanks Pablo Vazquez for the feedback.
2018-01-30 17:18:22 +01:00
3fde3902c1 Merge branch 'blender2.8' into greasepencil-object 2018-01-30 09:52:08 +01:00
7d48923671 GP Add Primitive: Don't make a copy of the new stroke. Just copy it over! 2018-01-30 19:04:54 +13:00
496064f1f3 GP Add Primitives: Attempted fix for double-clicking on the toolbar button
Check for what type of mouse-press it was, instead of just assuming
that the clicks are what we think they are.

Note: If things still go wrong, there's also now a debug-print there
(debug-mode only) to help track things down.
2018-01-30 19:04:54 +13:00
4cd2f80f9d Cleanup: Streamline logic here - just check once, not twice 2018-01-30 19:04:53 +13:00
e12b1c2a27 GP Add Primitive Ops: Remove the "avoid fast double clicks" event hack
This was making the operator unnecessarily clumsy to use, especially
for anyone used to the way that drawing tools everywhere else work.

Old workflow (with the hack):
1) Click Rectangle/Circle to start the operator
2) Click (Press & Release) in the 3D view to start drawing the shape
3) Click again (Press & Release) to stop drawing
(4) Click again, realising that you forgot to release the mouse in step 2
    (provided you realised why it "wasn't working")

New workflow (more in line with standard workflows):
1) Click Rectangle/Circle to start the operator
2) Press and drag in the 3D view to start drawing the shape
3) Release to stop drawing
2018-01-30 19:04:52 +13:00
e70d497e3e GP Add Primitives: Allow operator to work in Edit Mode too
It didn't really make sense why this was restricted to Draw mode only.
In particular, there are 2 good arguments for allowing it in editmode too:
 1) In many ways, it's more similar to a Copy/Paste or Duplicate
    operation in that it just dumps a bunch of stroke geometry
    into the scene without you having to draw anything. We allow those,
    so why not this.

 2) Users are used to being able to go into Edit Mode and add a primitive
    shape into the datablock to begin editing it. For consistency with
    other modes, and also to prevent the "Creation" tab looking stupid
    and redundant in EditMode, let's enable this.

Note:
* Sculpt/Weight Paint modes do not have this enabled for now. In those
  modes, users are less likely to be concerned with adding geometry,
  and more with modifying the existing geometry.
2018-01-30 19:04:52 +13:00
388bb6ec85 Cleanup: Use M_PI instead of converting from degrees to radians
Note: While the center/radius calcs may benefit from using the
BLI_math funcs, the current implementation is more direct.
2018-01-30 19:04:51 +13:00
4d99df8a9b GP Add Primitives: De-duplicate code
Most of the logic in gp_primitive_rectangle() and gp_primitive_circle()
was duplicated, and responsible for performing space-conversion stuff
on the 2d/screen-space coordinates.

This commit properly separates out these concerns, de-duplicating
code, and fixing a few other minor issues at the same time
(e.g. superfluous copies, and "edges" not getting initialised properly)
2018-01-30 19:04:50 +13:00
de29d5fe00 GP Add Primitives: Removed the requirement for an active layer
Previously, the add primitive operator (rectangle/circle) required
there to be an active layer present before it would allow you to draw
a new primitive. However, this reduced the usefulness of this tool
(especially if you intended to use these tools to roughly block out
the requried shapes first in a new/blank GP object).

There was no real reason for this limitation, so no, the operator will
create a new layer itself if necessary, just like the Draw operator
has done since day one!
2018-01-30 19:04:50 +13:00
00fe5d45d3 Cleanup: Remove redundant functions
These were just adding extra layers of abtraction/complexity
without serving any actual purpose.
2018-01-30 19:04:49 +13:00
498c203130 Rename "Chessboard" to "Checker Board" 2018-01-29 23:11:57 +01:00
240dbd295f Support multiframe for change color operator 2018-01-29 19:59:48 +01:00
c85edc8bcc Fix Undo problem with color picker 2018-01-29 19:48:11 +01:00
458aee0a94 Redesign off GP icons
Designed by Matias Mendiola

Thanks Pablo Vazquez for the feedback
2018-01-29 19:45:18 +01:00
99ee18c5a2 Merge branch 'blender2.8' into greasepencil-object 2018-01-29 18:33:11 +01:00
8f7f79e825 Enable drawing start with Shift + Mouse
This is necessary for lazy mode start
2018-01-29 18:24:09 +01:00
32a2edb985 Change Pattern drawing to use standard functions
Now the drawing is using the standard functions instead of custom drawing.

Thanks Pablo Vazquez for the trick
2018-01-29 18:15:09 +01:00
c5786b5430 Disable brush temp override for lazy mouse 2018-01-29 18:03:48 +01:00
5fc8ecd129 Use Shift key to toggle Lazy Mouse
Now while drawing you can enable or disable the lazy mouse with the shift key.

If the brush has lazy enabled, shift key disable it. If the brush has lazy disabled, shift key enable it.
2018-01-29 17:45:02 +01:00
5662874163 Replace Polygon Keymap to Ctrl+Shift
This keymap has been changed in order to free the shift key for Lazy Mouse
2018-01-29 16:54:26 +01:00
43a25f9e0f Remove Select keymaps in Drawing mode
These keymaps were enabled by error in this mode
2018-01-29 16:48:25 +01:00
db58fb6c9d Fix cursor error drawing polygons
The cursor had a wrong line due lazy mouse cursor mode that must be hidden in poly mode.
2018-01-29 16:39:52 +01:00
b7df69d3f4 Refine filter event for lazy mouse 2018-01-28 16:33:34 +01:00
bc309de654 Redesign how lazy mouse works
Before it was smoothing the stroke, but this was not the request. Now interpolate mouse position only.
2018-01-28 16:28:10 +01:00
e17f5584e1 Disable cursor color for fill brush 2018-01-28 13:56:15 +01:00
46d4ae5846 Changes in cursor size for lazy mouse 2018-01-28 13:43:54 +01:00
1a2dabbdc7 Small adjust to lazy mouse parameters 2018-01-28 13:36:14 +01:00
e99d2e2b82 Use brush color for lazy mouse line 2018-01-28 13:17:24 +01:00
8ae3c555ec Merge branch 'blender2.8' into greasepencil-object 2018-01-28 11:35:02 +01:00
b3e2c36c87 Fix error in rotation
When rotate using falloff the stroke was scaled because the scale factors was changed by falloff.
2018-01-28 11:20:33 +01:00
04da7dadbb Fix error in cursor color for sculpt modes
The cursor color only must be vsisible in draw mode, not in sculpt
2018-01-28 10:49:45 +01:00
b6d456b5de Fix error when delete all colors and redraw
When delete all colors and draw again, the color index was wrong.
2018-01-27 18:35:03 +01:00
459d4d0e43 Display current color on cursor 2018-01-27 18:27:27 +01:00
8b4dd2a234 More work for Lazy Mouse
Now, the last point is always added in order to get precise end points.
2018-01-27 17:19:26 +01:00
d3834fef65 UI: Move Lazy Mouse options to Stroke panel 2018-01-27 13:44:47 +01:00
6e2ac778b1 Merge branch 'blender2.8' into greasepencil-object 2018-01-27 13:34:17 +01:00
e44fa49310 New Lazy Mouse option
This option delays the mouse movements to create more controlled strokes.

The function calculate the optimal location anmix with th current location.
2018-01-27 13:25:02 +01:00
634e269887 Apply onion opacity factor when fade disabled
If the fade option is disabled, the opacity of the onion strokes is defined by opacity factor and not fixed as before.
2018-01-26 18:19:34 +01:00
bc1f58723c Rename new GP monkey object to "Suzanne"
(Same as we do for mesh monkey)
2018-01-26 16:29:14 +01:00
e3c802a404 Rename empty Grease Pencil object from "GP Object" to "Blank"
Also, name the Monkey palette "Suzanne" (same as we do for mesh datablock/object name)
2018-01-26 16:16:57 +01:00
e38b5adc4f Change minimum alpha value for Onion
Sometimes is necessary to make transprarent and before it was not possible using opacity slider.
2018-01-26 16:07:29 +01:00
13afe1db81 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_edit.c
	source/blender/editors/space_action/action_select.c
2018-01-26 10:54:44 +01:00
501f6b2f75 Merge branch 'blender2.8' into greasepencil-object 2018-01-25 12:25:45 +01:00
a43d39387c Merge branch 'blender2.8' into greasepencil-object 2018-01-24 16:43:39 +01:00
d695bcf28c Merge branch 'blender2.8' into greasepencil-object 2018-01-24 09:44:11 +01:00
fd2517559a Use "Grease Pencil" (not "GPencil") in the Add and Edit menus 2018-01-23 16:46:13 +01:00
Dalai Felinto
1cdcd77831 Fix one of many warnings ... 2018-01-23 12:14:02 -02:00
Dalai Felinto
1d5db1cf43 Icon names fixes after last merge
Bonus: Fix tooltip of GP object
2018-01-23 12:11:11 -02:00
Dalai Felinto
8a9ab51f4d Merge remote-tracking branch 'origin/blender2.8' into greasepencil-object 2018-01-23 12:02:08 -02:00
6ac4f76fd2 Merge branch 'blender2.8' into greasepencil-object 2018-01-23 10:34:47 +01:00
c695406536 Remove experimental brush 2018-01-22 19:22:16 +01:00
b0993bf7ec Set BOTH mode as default for fill brush 2018-01-22 19:22:16 +01:00
Dalai Felinto
adf93be121 Fix old .dat file for object origin icon 2018-01-22 15:47:52 -02:00
Dalai Felinto
38735cbb1c Merge remote-tracking branch 'origin/blender2.8' into greasepencil-object 2018-01-22 15:42:05 -02:00
Dalai Felinto
ec90897383 Leave it out uneeded changes from the .svg file 2018-01-22 15:21:48 -02:00
Dalai Felinto
779591efc6 Merge remote-tracking branch 'origin/blender2.8' into greasepencil-object 2018-01-22 15:14:17 -02:00
0813b3fd42 Merge branch 'blender2.8' into greasepencil-object 2018-01-22 17:54:30 +01:00
fa4c1ad525 Add option to reproject fill on Surface
Before, only origin was supported, now it can be reproject on object surface
2018-01-22 17:21:37 +01:00
55f7d9c127 Merge branch 'blender2.8' into greasepencil-object 2018-01-22 09:19:21 +01:00
d5db310737 Change Special menu to call picker
When the list of colors is too long, the menu is too long, so it's better call the picker menu.
2018-01-22 09:17:39 +01:00
23e365f559 Do no render edit points
The edit points are only visible in viewport but are disabled when make a render.
2018-01-21 16:40:56 +01:00
b8b2fc5660 Add color picker button 2018-01-21 16:25:57 +01:00
1899f24018 Use menu theme colors for color picker panel
Now, the panel colors are consistents with other UI areas.
2018-01-21 16:21:09 +01:00
e631de9a72 Change look of grease pencil color picker
As first step to convert to template, use rounded boxes and standard drawing routines.
2018-01-20 19:10:11 +01:00
4566ff6670 Use different Texture quality for render 2018-01-20 17:35:24 +01:00
689ddd24d8 Merge branch 'blender2.8' into greasepencil-object 2018-01-20 17:10:44 +01:00
bbd71c879e Fix modifier enable/disable on render mode
The old test to verify if the modifier was enabled in render mode used G_RENDER_OGL flag, but for new draw manager, there is a function for that: DRW_state_is_image_render()

Also fixed the problem the cache was not set as dirty before render, so the flags were not updated to draw the correct image.
2018-01-20 16:51:31 +01:00
b0c08068e8 Remove simplify render options
This options are not necessary because for render and viewport use the same options
2018-01-20 13:18:19 +01:00
e4e3f9a244 Fill stroke boundary must be included in strokes draw
If the option of boundary is Strokes, the special boundary strokes must be included as limits.
2018-01-19 16:52:53 +01:00
9533811eac Several fixes after merge
Mainly due parameter list changes and rename of macros.
2018-01-19 16:39:38 +01:00
d314cbe06d Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/gpencil_paint.c
	source/blender/editors/include/ED_gpencil.h
	source/blender/editors/space_outliner/outliner_draw.c
	source/blender/editors/space_view3d/view3d_draw_legacy.c
2018-01-19 16:31:03 +01:00
b1de16e8c2 Merge branch 'blender2.8' into greasepencil-object 2018-01-18 16:59:18 +01:00
6d37f37cf2 Cleanup redundant parameters 2018-01-18 13:16:21 +01:00
4492e1d08a Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/makesdna/DNA_scene_types.h
2018-01-18 12:01:18 +01:00
cfa7daf3a9 Fix problem with buffer when cursor outside camera view
Before, the stroke buffer was converted using the 3D cursor location, but if the camera moves and the cursor was on back of camera, the stroke buffer was not visible while painting.

Now, the conversion is done using the origin of the object and this avoid this problem.
2018-01-18 11:58:17 +01:00
c4a2515628 Merge branch 'blender2.8' into greasepencil-object 2018-01-17 16:09:09 +01:00
dff3ea0647 Change default smooth parameters for brushes 2018-01-17 14:14:17 +01:00
cd3c95afab Merge branch 'blender2.8' into greasepencil-object 2018-01-16 17:20:02 +01:00
0ff7c037bf Merge branch 'blender2.8' into greasepencil-object 2018-01-15 19:21:15 +01:00
abc361736b Fix error with normal vector calculation
In some weird situations, the normal vector of the stroke cannot be calculated and this produces errors, specially in modifiers like lighting modifier.

Now, if the stroke selected is not valid, try with the next stroke to get a right value.
2018-01-15 19:18:21 +01:00
b4a491234c Cleanup and fix comments 2018-01-15 10:47:27 +01:00
f65dbc81d7 Merge branch 'blender2.8' into greasepencil-object 2018-01-15 09:43:09 +01:00
a19b54a1c2 Changed panel back color
The panel back color makes the boxes more visible.
2018-01-14 14:41:40 +01:00
67d9b53868 Change text color for active color
The color of name text change if the color has the focus.
2018-01-14 14:36:57 +01:00
231efa8d58 Fix pattern error
After adding the color name in previous commit, the BLEND option was disabled and the pattern was invisible
2018-01-14 12:09:22 +01:00
43a226cc0a Allow a very long list of colors in picker
For very long palettes, resize panel.
2018-01-14 12:02:20 +01:00
ddcce00885 Merge branch 'blender2.8' into greasepencil-object 2018-01-14 11:17:07 +01:00
09f376ad8d New full set of Brush icons
Icons designed by Matias Mendiola
2018-01-14 11:10:21 +01:00
efe41cecfc Avoid colorpicker window outside view area
Some minor changes too.
2018-01-13 19:04:46 +01:00
de0ca25d6e Make color picker a floating panel 2018-01-13 18:25:22 +01:00
800dae17f9 Include color name in picker 2018-01-13 17:02:20 +01:00
d1f89c9362 New operator to clean boundary strokes
This operator is used to remove the boundary strokes that were created during fill.
2018-01-13 16:26:28 +01:00
25579ab43a Copy color name to color picked temp data 2018-01-13 16:03:11 +01:00
74d3f3c980 Merge branch 'blender2.8' into greasepencil-object 2018-01-13 13:05:17 +01:00
c29fccbccc New no fill strokes for fill boundaries
This special strokes can only be generated using a fill brush and pressing Alt key.

This type of strokes are required to draw fast boundary with the fill color for opened areas to use the automatic fill later.

The color of these strokes will be the fill color and not the stroke color.
2018-01-13 12:50:55 +01:00
d6a5007c81 Merge branch 'blender2.8' into greasepencil-object 2018-01-12 20:02:44 +01:00
b0595c30da Reformat draw mode and help lines for fill
Now the show help lines is a separated option and the draw mode can be used internally without intermediate step.
2018-01-12 20:01:56 +01:00
fad223212f Separate help modes for filling
Now the selector for help lines is separated. Before, some modes where not available because there was some UI options conflict.
2018-01-11 17:19:23 +01:00
e8e47db11e Cleanup. Fix comment 2018-01-11 16:49:19 +01:00
6812848350 Fix error when use fill only colors
The index of the color used was wrong.
2018-01-11 16:47:37 +01:00
520cfab17a Merge branch 'blender2.8' into greasepencil-object 2018-01-11 16:28:22 +01:00
b1af3e26e6 Minor adjust to pattern color transparency 2018-01-11 16:26:59 +01:00
cefa6ca482 Add Ctrl keymap while fill for free drawing
If press Ctrl key while using a fill brush, the brush is used as a normal drawing brush and the artist can draw any shape freely.
2018-01-11 16:11:06 +01:00
430091c8f3 Cleanup unused code 2018-01-11 15:51:12 +01:00
85d4986b7f Fix error after merge
The function name has changed
2018-01-11 12:25:12 +01:00
8df44ca45d Merge branch 'blender2.8' into greasepencil-object 2018-01-11 12:06:10 +01:00
f6b7278a89 For fill brush use only fill colors
If the brush is for fill, the list of color must be limited to fill colors only, except the flag to override this, is enabled.
2018-01-11 12:05:24 +01:00
7e49ba94b3 Small adjust to panel size 2018-01-11 11:55:58 +01:00
63b05784bc Change panel back color 2018-01-11 11:54:04 +01:00
c3e28bad8d Add a pattern to see alpha colors
If the color has alpha, need a pattern to see the transparency effect.
2018-01-11 11:48:33 +01:00
ecba7db010 Add diagonal line if fill color
Add a line if the color box include stroke and fill color.
2018-01-11 11:25:09 +01:00
3fea7cb073 Add ui_scale factor to color picker 2018-01-11 10:04:36 +01:00
50da4885c9 Merge branch 'blender2.8' into greasepencil-object 2018-01-10 19:27:26 +01:00
682685ba22 End operator if click out of panel 2018-01-10 19:15:52 +01:00
b929682dab Remove header text functions
This text is not used in this operator
2018-01-10 19:12:17 +01:00
5d2975382c Set color function 2018-01-10 19:09:36 +01:00
f9426cd686 WIP: Redo colorpicker drawing and mouse cursor 2018-01-10 18:06:05 +01:00
88381086b2 Cleanup code 2018-01-10 14:22:49 +01:00
b8475a1d4c Replace reverse findlink
Fix error in previous commit using reverse find
2018-01-10 14:20:28 +01:00
3138d4468e WIP: Display colors bar
Basic display of colors.

Still the selector is not working.
2018-01-10 11:17:36 +01:00
2549076da1 WIP: Basic structure for new Color PIcker
This operator is enabled using F6.
2018-01-09 19:36:27 +01:00
2774a47f38 Merge branch 'blender2.8' into greasepencil-object 2018-01-09 17:32:25 +01:00
3a7c7c621a Merge branch 'blender2.8' into greasepencil-object 2018-01-09 16:41:46 +01:00
d8ff7b2d15 Disable points if disable_fill is enabled 2018-01-09 08:59:41 +01:00
0c11d68b22 if disable fill, the colors with fill must be omitted
This is done to avoid double borders when fill a previous filled area.
2018-01-08 17:28:19 +01:00
b043ea26ca Use Shift key to fill on back
This key override the draw on back option of the panel for the current fill only.
2018-01-08 17:23:41 +01:00
87d2586c9d Fix Fill over filled colors
The fill offscreen render never must use the fill to avoid false filled areas.
2018-01-08 16:43:08 +01:00
ad29094f91 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/datafiles/locale
        release/scripts/addons
	release/scripts/addons_contrib
2018-01-08 10:41:43 +01:00
807c7b7819 New Weight Smooth operator
Operator to smooth the weights of strokes.
2018-01-07 22:24:59 +01:00
40229d2ab9 Include Thickness of new Fill Stroke
This parameter defines the thickness of the stroke created by fill operator.
2018-01-07 20:27:25 +01:00
c9fb4c8932 Fix problem with drawing flags 2018-01-07 20:15:18 +01:00
f59bbc8524 WIP: More work on fill using new drawing method 2018-01-07 18:09:36 +01:00
7bca6c0b94 Apply new shader to old draw method
(used in modal operators like fill, primitives or interpolate)
2018-01-07 17:46:20 +01:00
607b72584d Missing in previous commit 2018-01-07 17:31:24 +01:00
b31f3c556d WIP: Reorganize parameters in old draw mode
The list of parameters was too long and it's better pass a struct.

This is the first step to use the new shaders with the same functions of Draw manager. This is used in interpolations, filling and primitives while the operator is running.
2018-01-07 17:22:08 +01:00
0562da8166 New Weight Invert operator
This operator invert the weights of the strokes.
2018-01-07 11:59:22 +01:00
bb809c27b2 Make weight paint vertices smaller 2018-01-06 20:17:58 +01:00
33b0d64b24 UI: Change Simplify Name 2018-01-06 17:02:17 +01:00
4b644ea59f Enable Draw on Back for fill Brushes 2018-01-06 14:17:42 +01:00
a21a04efe4 Merge branch 'blender2.8' into greasepencil-object 2018-01-06 10:56:42 +01:00
617839721d Scale stroke thickness when scale stroke
Now when scale a stroke, the thickness is scale to.

The operator to scale only thickness is available too using Shift+S
2018-01-06 10:53:17 +01:00
3c705f4b49 Merge branch 'blender2.8' into greasepencil-object 2018-01-05 17:28:30 +01:00
5606eeeb19 Apply falloff to Scale 2018-01-05 17:24:28 +01:00
67a03921fd Apply falloff to rotation 2018-01-05 17:18:22 +01:00
f2c2f6edec Apply falloff to transform 2018-01-05 16:35:12 +01:00
7ce68ff910 WIP: Save falloff factor for transformations
This data must be used by transformation to determine the effect of the change.

Also enabled the falloff option for edit mode.
2018-01-05 10:48:28 +01:00
a8eec08cf3 Add new parameter after merge
The function has a new parameter
2018-01-04 11:44:19 +01:00
232e805cf4 Merge branch 'blender2.8' into greasepencil-object 2018-01-04 11:31:32 +01:00
abdce7f6ac New simplify fixed operator
This simplify used the same algorithm used in modifier.
2018-01-04 11:29:25 +01:00
2b0c317fb2 New option to fill using colors without fill
This option allows to use for filling a color without fill. This can be very useful for create clean strokes base on several strokes.
2018-01-04 11:13:06 +01:00
96e33c428e Add simplify level
Added a new parameter to define the number of times the new fill stroke is simplified using fixed simplify algorithm.

This simplify reduces the number of points but also the precision of the filling shape for large values.
2018-01-04 11:03:03 +01:00
902c9d01d9 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
2018-01-04 09:44:50 +01:00
dfb68726eb Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
2018-01-04 09:41:09 +01:00
2dfdff0c2e WIP: Improve interface for fill brush
Now is possible to delete it and can have several of them.
2018-01-04 09:37:20 +01:00
b744f47eed Cleanup: Remove dead code, Fix incorrect labels, and Make things more Pythonic 2018-01-04 13:13:14 +13:00
80caab7f5d Don't show edit lines while play animation
The edit lines and points are hidden when the animation is playing.
2018-01-03 19:31:15 +01:00
bd30471479 UI: Make visible only fill color in fill mode
The special menu only shows colors with fill when using fill brush
2018-01-03 19:25:52 +01:00
889a0707c1 Make boundary lines display optional
Now the red lines display that help to show the boundary of strokes is optional.
2018-01-03 19:21:47 +01:00
7f3c86731a WIP: More work for filling brush 2018-01-03 17:46:42 +01:00
99645fcb0c UI: Remove fill operator
Now it's a brush
2018-01-03 17:46:42 +01:00
ba85cecc63 New icons for drawing brushes
Icons designed by Matias Mendiola
2018-01-03 17:46:42 +01:00
b26307991b WIP: Use a brush for filling
Still need more work, but this commit adds the basic structure.
2018-01-03 17:46:41 +01:00
37dab69d96 Merge branch 'blender2.8' into greasepencil-object 2018-01-03 13:00:32 +13:00
8353739de6 Merge branch 'blender2.8' into greasepencil-object 2018-01-02 22:14:09 +01:00
e91f2852eb WIP: Add a leak tolerance for narrow gaps
This is a initial implementation for filling areas with narrow gaps between strokes.

Maybe the limit of the pixel size must be visible in UI panel.
2018-01-02 22:12:56 +01:00
f094eb7c5f Fix memory leak 2018-01-02 13:35:13 +01:00
1d56dce4b7 Cleaunp blank line 2018-01-02 12:58:08 +01:00
a37437af56 UI: Reorganize draw specials menu options 2018-01-02 12:23:20 +01:00
98174d2fa4 New color selection in draw specials menu
A quick color selection in draw special menu. In the future it would be good to add a small icon with the color, but now is not working in the menu
2018-01-02 12:17:30 +01:00
160e02e570 UI: Fix pie menu 2018-01-02 11:57:44 +01:00
905e079dea Add P keymap for fill operator 2018-01-02 10:22:27 +01:00
b0cb6135c2 Remove use of Global Main 2018-01-02 10:17:45 +01:00
6559123149 Cleanup code 2018-01-01 17:45:04 +01:00
dca261bb25 Cleanup: Remove redundant code 2018-01-01 17:22:53 +01:00
18f31a1bc9 Free image memory 2018-01-01 17:13:22 +01:00
389c25e438 Fix problem with axis reproject
Need to convert to object space before reproject
2018-01-01 11:30:01 +01:00
b3848230b3 New reprojection mode: Axis
This new mode reproject the strokes using the same logic of drawing in a locked axis.
2017-12-31 17:16:05 +01:00
240b47b69d Fix error with colorname
This solve the Undo problems too.
2017-12-31 11:03:21 +01:00
60357ef217 Fix error with colorname 2017-12-31 11:03:00 +01:00
26fcf08a4a WIP: First step to support undo in filling 2017-12-30 19:44:11 +01:00
d6d0fbf824 Remove Undo flag 2017-12-30 19:28:23 +01:00
2e57a146ed Cleanup code 2017-12-30 19:13:10 +01:00
0984218adb WIP: Add fixed simplify
The RDP simplify is not working fine, so the simple mode is used now.
2017-12-30 19:11:38 +01:00
42573e00a5 Add stroke to tail
The initial idea was to add to head (on back), but after testing it's better add at the end on top of previous strokes.
2017-12-30 17:25:14 +01:00
be6a5008d7 Merge branch 'blender2.8' into greasepencil-object 2017-12-30 16:58:55 +01:00
c59f6df5eb Fix reproject error for filling 2017-12-30 16:58:03 +01:00
a53a6a80fd Fix problem with primitive reproject
The apply parent must be applied after reproject.
2017-12-30 13:18:07 +01:00
d5ca7d20ed Add primitives to draw special menu 2017-12-30 12:50:58 +01:00
c6ff9d7164 Avoid fill with color without fill enabled 2017-12-30 12:04:05 +01:00
9b60e79b65 Add fill operator to special menu 2017-12-30 12:03:25 +01:00
6726150803 WIP: Fix problems with stroke location
Still problems with reproject
2017-12-29 18:03:47 +01:00
f0ce194137 Use general function to reproject stroke 2017-12-29 17:06:14 +01:00
1fac2cda96 WIP: Add status message and new keys
Still on progress
2017-12-29 10:24:29 +01:00
9c59025289 Remove warning message 2017-12-28 22:12:44 +01:00
5d5a146f6a WIP: Apply smooth to fill 2017-12-28 22:12:28 +01:00
4ca90c7a99 WIP: Create stroke for fill
First step to create strokes
2017-12-28 19:45:48 +01:00
24c6476daf Extract function to be shared in other modules 2017-12-28 16:25:40 +01:00
76518e2a9b WIP: First steps to implement Moore-Neighborhood algorithm
This algorithm is to detect the outline of a image. Now, the function only adds a blue line with the shape to the debug image.

Next step is use this array of points to create a stroke.
2017-12-28 13:34:43 +01:00
6cc0e65f70 Merge branch 'blender2.8' into greasepencil-object 2017-12-28 11:12:31 +01:00
87353fd9f3 Cleanup: Remove debug lines and change some comments 2017-12-28 11:10:55 +01:00
919cdad3e4 New duplicate frame operator and special menu
This operator duplicates the active frame in active (or all) layers. This is very handy for creating step by step animation.

Also, added new special menu in sculpt with W key.
2017-12-28 10:57:51 +01:00
b5696a4701 Merge branch 'blender2.8' into greasepencil-object 2017-12-27 17:04:58 +01:00
d49c6bbd6d WIP: More work in boundary fill 2017-12-27 17:04:00 +01:00
a56c7a5cac WIP: Improve offscreen render
Now, all the render is done in a image to debug results.
2017-12-26 17:58:49 +01:00
6e81d08783 WIP: Add debug lines to show boundary 2017-12-26 12:34:19 +01:00
02680cab7e WIP: Implement Boundary fill algorithm
This algorithm is used to fill the shape that will be used to create the new stroke after analyze the external outline.

The fill is no working yet becaus ethe offscreen drawing is still on progress.
2017-12-25 17:19:02 +01:00
2c6605cd79 Merge branch 'blender2.8' into greasepencil-object 2017-12-23 12:38:39 +01:00
08edee5736 Fix fill problem in opacity modifier
The fill color must be set separated of stroke color. This error was produced by previous commit.
2017-12-22 22:10:36 +01:00
feb0b0ddec Fix opacity modifier using vertex group
Changes in how the vertex group is used in modifier.
2017-12-22 20:02:08 +01:00
3e9db0a92b Fix merge error in brackets 2017-12-22 16:58:41 +01:00
046d8ef6f1 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2017-12-22 16:46:27 +01:00
4523a35c1f Cleanup: Put includes in alphabetical order 2017-12-22 17:07:47 +13:00
3c5d358d89 Joining GP objects also merges + fixes animation data for the merged datablocks 2017-12-22 17:04:22 +13:00
8931c901bf Cleanup: Make it clearer which datablock/object we're dealing with
* gpd_act -> gpd_dst   ("_act" could also mean "active one we're looking at now)
* gpd     -> gpd_src   (we sometimes refer to "gpd" as the active one we're working on)
2017-12-22 15:03:44 +13:00
3d7732eca0 Fix parameter list after merge 2017-12-21 18:21:46 +01:00
aef22a2bb5 Merge branch 'blender2.8' into greasepencil-object 2017-12-21 18:10:31 +01:00
43adb12a1c Cleanup: comments and reorganize 2017-12-21 18:08:55 +01:00
e6e7ba4a08 Apply all modifiers first
The previous commit was the Context missing as parameter and this was the reason of the errors
2017-12-21 17:59:16 +01:00
5f39d41c1f WIP: Initial code to apply modifiers 2017-12-21 16:55:50 +01:00
0362987c0a Copy Vertexgroup when join
The vertex groups were not included in the join.
2017-12-21 16:29:38 +01:00
b7e96c5001 Fix duplicate layer name when join 2017-12-21 13:33:05 +01:00
d92bc7d09a WIP: Basic Join object operator for grease pencil
Still pending:

- Modifiers
- Animation data
2017-12-21 12:52:17 +01:00
be58b71cfc Merge branch 'blender2.8' into greasepencil-object 2017-12-21 10:44:46 +01:00
Dalai Felinto
143f4e52c5 Fix for T53599: OpenGL render with transparent background
I had to make Eevee draw its scene in the scene pass (before it was doing it
in the background pass). This is not ideal since reference images require
a separation between scene and background.

But it's the best way to solve it now. Clay is working fine.
2017-12-20 19:11:38 +01:00
44408d6539 Add warning for Fill operator not implemented yet 2017-12-20 17:47:44 +01:00
796aae61d9 WIP: Define basic struct/functions for modal fill
Not implement yet.

Prepare the different elements required by modal operator.
2017-12-20 17:38:50 +01:00
5cb127a7bd Merge branch 'blender2.8' into greasepencil-object 2017-12-20 16:55:16 +01:00
1dba3b5a23 Remove temp hack for MSVSC2017 compiler 2017-12-20 10:24:32 +01:00
54feb32d9c Fix segment fault when rotate in empty frame
The problem was with the new created frame that was not assigned to loop variable.
2017-12-19 19:41:50 +01:00
9f0978ace6 Provisional hack for fixing MSVC2017 error
This fix will be replaced by final Sergey solution.
2017-12-19 19:15:58 +01:00
6cc85be8c9 Fix desgraph code missing in merge 2017-12-19 17:54:48 +01:00
bb81a12459 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/datafiles/blender_icons.svg
	release/datafiles/locale
	source/blender/depsgraph/intern/depsgraph_tag.cc
	source/tools
2017-12-19 17:43:29 +01:00
259d7a23e6 Reorganize versioning code
After last 2.80.3 version bump, the code can be reorganized and it can be removed any custom hack for Hero files.
2017-12-19 17:06:38 +01:00
cd0f974ce3 Fix segment fault when play with onion
For some reason, when press play there is a delay in the animation flag check and this produces errors. To be sure, we set cache as dirty because the frame is changing.
2017-12-19 16:47:41 +01:00
dc834e25ba Fix compiler warning
The previous commit was wrong
2017-12-18 19:20:16 +01:00
2d533461f1 Fix compiler warning 2017-12-18 19:17:07 +01:00
86c3fbf0db Add alpha factor to mask while filling
If the color fill opacity is equal to 1.0, it's very hard to see the strokes that you want to fill. With this change, always the stroke is visible while painting.
2017-12-18 17:50:21 +01:00
0a3e36df55 Fix UI warning 2017-12-18 17:43:52 +01:00
a6730c6995 Fix problem with merge down
The problem was if the layer below had animation in frames not present in top layer. As the active frame of top layer was the previous keyframe, after merging, the draw of bottom layer replaced the draw of top layer and the result was that some drawings were missing.

The solution was to duplicate the active frame in top layer before merge the bottom layer.
2017-12-18 17:29:09 +01:00
6efbe39712 Fix: Don't assume that rect starts from 0,0 2017-12-19 01:14:49 +13:00
140649b872 Fix: Missed these in last commit 2017-12-19 01:13:33 +13:00
cbe4c97de3 Cleanup - Save off multiedit state instead of querying it all the time 2017-12-19 00:53:47 +13:00
9c30702372 Cleanup - Split out the GP stroke sculpting loop-over-strokes logic into a separate function 2017-12-19 00:35:35 +13:00
4015bed382 Cleanup + Optimisations for GP Sculpt Multiframe
* Only initialise the falloff curve's internal data once per run,
  instead of once per layer. We can probably even make this only happen
  once for each run of the operator, as it shouldn't be possible to change
  the curve in the meantime (requiring the data to be recalculated)

* Save off the multiframe falloff option into a variable instead of
  doing the full check each time.

* Only calculate "diff_mat" once for each layer, instead of once for
  each GP frame for multiedit. (Note: We weren't taking the frame numbers
  into account anyway, so it doesn't matter to pull this out. However,
  technically, if the layer was parented, we'd actually need to have been
  recalculating the parents transforms for each of the multiedit frames
  to get the real intended effects)
2017-12-18 21:47:28 +13:00
f1996fa124 Minor Optimisation for GP Grab brush
Write directly to the point instead of writing to a temporary value first
2017-12-18 21:29:30 +13:00
56e73e31ce WIP: Replace GL types by generic types 2017-12-17 20:36:08 +01:00
5fdb22ffd7 WIP: Initial test for offscreen render
Initial test to make a proof of concept of the render in textures.
2017-12-17 20:16:29 +01:00
92c3b81490 Fix segment fault when delete object
The active object got null and this produced a segment fault.
2017-12-17 19:57:33 +01:00
09bc242bfd Use round caps while drawing 2017-12-17 17:16:41 +01:00
6147d8c9d3 Reduce size of round cap 2017-12-17 17:16:25 +01:00
7e52e6839c Merge branch 'blender2.8' into greasepencil-object 2017-12-17 16:28:02 +01:00
95dcd183fe New rounded end caps
Now the stroke ends are rounded to get more artistic look.
2017-12-17 16:18:16 +01:00
51a22cd6db Merge branch 'blender2.8' into greasepencil-object 2017-12-16 10:54:31 +01:00
2dff68f423 Fix multiframe error when lock layer
There was a segment fault if the some layer was locked and enable multiframe edit / sculpt or weight paint.

The shading group must be created because is used in multiedit lines.
2017-12-16 10:46:09 +01:00
5f527f0885 WIP: Experimental Offscreen buffer for fill
Simple implementation of stroke drawing to texture
2017-12-15 18:34:27 +01:00
8dfc08d14e Fix merge errors
There was a problem with struct byte alignment.
2017-12-15 13:17:20 +01:00
384d1f80ad Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
	source/blender/draw/intern/draw_cache_impl.h
	source/blender/makesdna/DNA_scene_types.h
2017-12-15 12:44:37 +01:00
ca6588d5da Delete with Border select in paint mode
This commit is similar to Lasso, but for border select.
2017-12-15 12:34:31 +01:00
c4dbe9448c New Eraser with Lasso select
When you are in paint mode, if press Ctrl+Alt and select with lasso tool, the points are removed.

This is a request of the Hero team after been working in cleanup process. The Lasso delete allows to remove very fast areas of the drawing.
2017-12-15 12:31:13 +01:00
4de69e3e1a Cleanup: Function to avoid code duplication 2017-12-15 11:44:38 +01:00
fa2cd280ac Add Erase stroke with Ctrl key
If press Ctrl over a stroke while using the eraser, the stroke is fully deleted, not point by point
2017-12-15 11:40:22 +01:00
7f419a5615 Enable Hard Eraser with SHIFT
While you are drawing, if press Shift key, the eraser delete points with one contact only and does not depends of pressure.

This is very useful for fast remove.
2017-12-14 18:16:09 +01:00
fe4f00d31b WIP: Basic modal structure for fill operator
This is the first step to implement a fill operator.

This commit only adds the modal operator but the filling is not implemented yet.
2017-12-14 17:05:20 +01:00
858cc7ac9d Merge branch 'blender2.8' into greasepencil-object 2017-12-13 16:48:31 +01:00
e4a3c50d12 Cleanup: Use mathlib funcs instead of inlined math 2017-12-13 22:28:21 +13:00
aed2a49571 Cleanup: Whitespace 2017-12-13 22:18:37 +13:00
f775fff246 Cleanup: Split GP Sculpt and Weight Paint panels into separate classes
This resolves the need for the draw_header() + empty bl_label
hacks used to try and get this changing dynamically.
2017-12-13 22:09:43 +13:00
54aefbf789 Cleanup: Various small issues noticed earlier
* Rename BKE_get_falloff_factor() to BKE_gpencil_multiframe_falloff_calc()
  and make it return value instead of passing in a pointer to fill.

* Rename "gso->falloff" to "gso->mf_falloff" to be less ambiguous

* Fix indentation issues in gpencil_brush.c
2017-12-13 22:09:41 +13:00
411e9b6731 Fix: Remove leftover debug print 2017-12-13 22:09:40 +13:00
a0c462ed42 Fix problem when hide collection
When hide the collection the strokes were not hidden.
2017-12-12 17:24:03 +01:00
2bba82ad7f Merge branch 'blender2.8' into greasepencil-object 2017-12-12 10:32:31 +01:00
d1cf5b54b5 Apply scale weight to Offset modifier
This parameter was using the weight in a wrong way. As the offset is a change in the values, the default value change is 0, not 1, so a scale offset of 1 means add 1 to default scale.
2017-12-12 09:29:22 +01:00
dd5e338661 Merge branch 'blender2.8' into greasepencil-object 2017-12-11 10:40:03 +01:00
7babe1f40c Improve Simplify modifier
- Now it's possible to define number of iterations for fixed mode.
- New mode selector instead of checkboxes
- Changes in UI
2017-12-10 17:10:49 +01:00
2ed89b09d2 Added ID_GD to the OB_DATA_SUPPORT_ID/OB_DATA_SUPPORT_ID_CASE macros
From the looks of things, all object-linked ID types should be
included in here.

While checking on this, I also found a missing case for GP object
in Main.objects.new()
2017-12-11 00:42:40 +13:00
5b56788cee Merge branch 'blender2.8' into greasepencil-object 2017-12-10 10:21:16 +01:00
ad7d868870 Change Hook modifier flags
There were some flags that must be removed.
2017-12-10 10:20:28 +01:00
dc686e1d82 Simplify use of VFX shading groups
The drawing functions was using an additional shading group pointer that it was not used, so it can be removed.
2017-12-10 10:16:51 +01:00
87fe1e5af2 Cleanup: Remove intermediate variable for Wsize 2017-12-10 09:24:14 +01:00
e166558ddd Rename property for full color and fill 2017-12-10 09:20:37 +01:00
df07efeeef Fix typo error using wrong variable 2017-12-09 23:27:45 +01:00
6957967e99 Apply weight only for loc/rot
The weight cannot be used for scale.
2017-12-09 22:52:57 +01:00
eb47e7e219 Offset modifier cannot use weight
The weight is a parameter that produces weird results.

Remove this option while find a better solution.
2017-12-09 20:58:59 +01:00
740506c7af Add new option to simplify alternate points
THis option remove alternated vertex from stroke except the extremes
2017-12-09 20:52:20 +01:00
c4e595aaf3 New Normalize thickness parameter
Now the thickness modifier has a parameter to assign the same thickness to all strokes.
2017-12-09 20:09:43 +01:00
fc38575461 New Vertex Group menu with Ctrl+G in Edit mode 2017-12-09 19:54:12 +01:00
40e6d673d8 UI: Expand default palette color list
The gray color was hidden.
2017-12-09 19:34:49 +01:00
62c694817e Change name in Add Object menu 2017-12-09 17:44:24 +01:00
25dbc0a9d4 Change Q key to show editlines and multiedit lines
New keymap:

Q: Toggle Edit lines
Shift+Q: Toggle Multiframe lines
2017-12-09 17:40:30 +01:00
4aee6cf376 Show Edit Lines must be a main switch
This option must be a general switch and not be affected by multiframe edition
2017-12-09 17:23:08 +01:00
fbdc28bab7 Disable by default simple subdivision 2017-12-09 17:15:20 +01:00
b1e9fd5e2b UI: Add alpha to colors in color list
Sometimes is better to access to alpha from here and not from stroke or fill panel.
2017-12-09 17:09:57 +01:00
7335e09129 Add default grey color with fill to default Palette 2017-12-09 17:02:35 +01:00
73d5253681 UI: Remove slider mode for thickness change 2017-12-09 16:58:01 +01:00
23a0b821d3 Remove strength curve in Pencil brush
This default was not working fine in all devices.
2017-12-09 16:52:48 +01:00
568f55e3cc New Draw Specials menu with X key
Now this menu only has the option to delete frame, but can hold more options in the future.
2017-12-09 16:50:33 +01:00
9c350fa98f Change default onion mode to keyframes 2017-12-09 16:42:10 +01:00
7141870483 Cleanup: Remove unused code 2017-12-09 16:35:21 +01:00
1955607d69 Fix pixel scale in VFX pixel 2017-12-09 16:34:34 +01:00
4cf759493d Avoid div by zero 2017-12-09 16:30:38 +01:00
b6b9e14fb6 Remove unused field 2017-12-09 16:25:43 +01:00
8707d29917 Fix VFX Swirl modifier
There was a problem with the conversion between screen space and camera space.
2017-12-09 16:20:39 +01:00
ac102ff163 Change Energy scale * 100 2017-12-08 19:48:21 +01:00
dc70a28c89 Fix problems with vfx light modifier
There was some problems with coordinate system between screen space and
camera space.
2017-12-08 19:19:22 +01:00
4286b5d424 Fix problems with VFX light modifer
There was a problem with the conversion of coordinate system between screen space a camera space.
2017-12-08 19:12:29 +01:00
3052223870 Fix: Add depsgraph relations from Palettes to GP data
This fixes problems where changing Palette setings (such as fill opacity)
should refresh the viewport (e.g. if there wasn't a fill before, changing
the slider should make it appear, instead of requiring a framechange to
make that happen).
2017-12-08 18:25:14 +13:00
401b9ee907 Fix compiler warning 2017-12-08 17:13:50 +13:00
28d9ad0ce1 Merge branch 'blender2.8' into greasepencil-object 2017-12-08 15:50:23 +13:00
a8fac7eca9 WIP: Testing new system to define light position 2017-12-07 22:50:17 +01:00
e77117f87f Cleanup: Remove unused variables 2017-12-07 10:07:50 +01:00
9df920be2e WIP - Some debug code to try to figure out why artists are getting random crashes here
Start blender with the debug (-d) flag to see debug prints for
cases of unhandled updates.
2017-12-07 19:40:09 +13:00
b2c84c5363 Fix merge error 2017-12-06 22:22:59 +01:00
35f774d269 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
2017-12-06 22:15:18 +01:00
e051af9cfd Add VFX Light a object to define light position 2017-12-06 22:07:14 +01:00
2772e1564e Remove color of light
After run some test, this value is not valid in 2D. To tink there is a modifier already.
2017-12-06 21:32:05 +01:00
fabf8717b3 Use function to avoid duplicated code 2017-12-06 17:50:10 +01:00
a3930268e1 New VFX light modifier
This modifier simulates a point light over the stroke. There is not shadows support and use its own internal lamp point. Only ambient and diffuse.

The use of this VFX is to get special effects. In the future, a real lighting system can be implemented using normal Blender lamps, but this is different of this modifier.
2017-12-06 17:41:56 +01:00
b2f32605d2 Merge branch 'blender2.8' into greasepencil-object 2017-12-05 19:05:04 +01:00
4420dc9d71 Merge branch 'blender2.8' into greasepencil-object 2017-12-05 17:05:06 +01:00
0daa869514 Change Drawing brushes default radio 2017-12-05 17:03:31 +01:00
6b4a7cd104 Make Noise position factor less sensitive 2017-12-05 15:53:58 +01:00
ac8e2772dc Change default Drawing brushes 2017-12-05 12:39:11 +01:00
2bb3c94b54 Increase again the maximum value for sculpt brushes
For some operations the old value was too small.
2017-12-05 11:14:46 +01:00
1739e1d6eb Change default edit line color
The alpha was too low
2017-12-05 11:09:35 +01:00
0dfa3436d8 UI: Add show edit line button to bottom bar 2017-12-05 11:05:56 +01:00
859eefde45 Change default Sculpt brush to PUSH
This default only works for new files, but it doesn't change old files.
2017-12-05 10:55:55 +01:00
a0c2f41d12 Set Ink brush as default 2017-12-05 10:45:22 +01:00
055bbc43e6 Increase maximum sculpt brush size 2017-12-05 10:42:53 +01:00
10228e6a3b UI: Move brush settings to bottom 2017-12-05 10:33:13 +01:00
2b50ea8eaf Increase maximum thickness 2017-12-05 10:32:46 +01:00
0891946c24 Change default pixfactor to 1000 2017-12-05 10:28:04 +01:00
bb217e42ca UI: Set panels closed by default 2017-12-05 10:21:21 +01:00
f635700d3d Merge branch 'blender2.8' into greasepencil-object 2017-12-04 16:56:09 +01:00
40cc91e630 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/readfile.c
2017-12-04 15:57:10 +01:00
1ddd023be1 Merge branch 'blender2.8' into greasepencil-object 2017-12-04 08:29:08 +01:00
4775b84ad9 Merge branch 'blender2.8' into greasepencil-object 2017-12-03 08:47:31 +01:00
a5ea509f38 Revert "Temp fix to compile"
This reverts commit 06950efb94.
2017-12-03 08:46:23 +01:00
06950efb94 Temp fix to compile
I change this lines waiting for Sergey final fix in Blender2.8 branch
2017-12-02 12:25:08 +01:00
1dce29a10f Cleanup previous fix code 2017-12-02 11:41:06 +01:00
3fb13ea5ff WIP: Fix some merge errors
Still some more errors pending
2017-12-02 11:39:28 +01:00
6f213c32e8 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2017-12-02 11:28:07 +01:00
05b82b21cc Increase default sise of batch slots 2017-12-02 11:17:10 +01:00
f6c77e51dc Cleanup: Remove unused parameter 2017-12-02 11:04:08 +01:00
dedeee51ac Replace hardcode value with define 2017-12-02 10:46:30 +01:00
ddec812c5b Fix crashes after selecting GP keyframes with onion skinning enabled
The code here was still using the old approach of just tagging all
GP datablocks for recalculation, instead of the newer depsgraph
tagging approach.
2017-12-02 11:37:11 +13:00
3f8be67811 Minor tweak to the "bell" curve for Multiframe Falloff for smoother curve
While this may not be "technically" correct for a Gaussian curve,
visually (judging from the curve) this seems to be a lot smoother.
2017-12-02 11:11:50 +13:00
809fc4807a Make falloff function external to reuse
Move the calculation of falloff factor to a separated function to be reused in transformations.
2017-12-01 17:27:51 +01:00
c78e8b0563 Merge branch 'blender2.8' into greasepencil-object 2017-12-01 15:58:09 +01:00
fbd80673c8 Fix falloff error when layer has no active frame 2017-12-01 15:56:33 +01:00
a960060ef2 UI: Minor changes to enable/disable multiframe options 2017-12-01 10:53:48 +01:00
4e3fb10dc4 Merge branch 'blender2.8' into greasepencil-object 2017-12-01 10:35:28 +01:00
36188466da UI: Show falloff only in sculpt mode
Changed the icon and other minor changes.
2017-12-01 10:32:49 +01:00
d6ec57055f Redo Hero initialization curve hack code
There was a problem aving files. The curve was reset for each reload.
2017-12-01 10:09:43 +01:00
1b5561cf03 GP Modifiers: Split into multiple columns
The modifiers list was starting to get a bit long to just have all of
them in the same column.

Also fixed various typos and tweaked some tool tips.
2017-12-01 16:19:11 +13:00
4324242557 UI Tweak: Move the multiedit toggle to the panel header (instead of being a separate button inside) 2017-12-01 15:30:11 +13:00
4af8f8574a Added comment noting why the GreasePencilStrokeSculptPanel has an empty label 2017-12-01 15:27:16 +13:00
e13875ec17 Cleanup: Fix comment 2017-11-30 23:09:52 +01:00
e7dea06ba5 Temp Hack: Fix initialization code for Hero open movie files
The initialization code must be moved to next version to manage Hero files.

This section of code must be merged to the previous version as described in the comments.
2017-11-30 22:06:53 +01:00
042298f6a3 Adjust UI to use new properties for falloff 2017-11-30 20:11:10 +01:00
6979cc61e9 WIP: Calculate falloff factor 2017-11-30 20:03:59 +01:00
cee80b3317 New function to get frame range selected 2017-11-30 19:11:45 +01:00
4cbd5933f7 WIP: New Gauss bell curve preset 2017-11-30 18:55:05 +01:00
c787419600 WIP: Implement new cuve for multiframe falloff
Still need to define curve with bell shape and apply the falloff to multiedit.
2017-11-30 17:34:48 +01:00
ee7e4d25d5 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/object/object_relations.c
2017-11-30 15:34:21 +01:00
f86f826f19 GP Build Modifier - Layer Masking support 2017-11-30 17:17:16 +13:00
52aa4a8af5 Fix: Menu with various extra operators for active palette color was missing 2017-11-30 16:34:58 +13:00
00c18441bf Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
	source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc
2017-11-29 18:58:08 +01:00
ca348646a3 Fix merge errors 2017-11-29 16:59:23 +01:00
c89d24ccbd Merge branch 'blender2.8' into greasepencil-object 2017-11-29 16:49:39 +01:00
0ecbe2171a New Grease Pencil Offset modifier 2017-11-29 16:47:25 +01:00
645b146395 Avoid some operators in multiframe edit mode
As initial idea is better to keep limited to single edit mode, but maybe in the future we can enable it.

The reason to limit them is because in some situations the artist can get confused with the edition he did if multiframe is activated and could consider the operation as a bug when really was working as expected.
2017-11-29 12:22:28 +01:00
e425cbb99f Fix multiframe delete
The stroke delete was not working with multiframe because it was checking only active frame and not the whole selected frames range.
2017-11-29 12:06:40 +01:00
849337bd78 Move Paper settings to View
Now the paper can be enabled by view and not by scene as before because this is a view settings.

Thank Pablo Vazquez for his UI feedback.
2017-11-29 11:45:43 +01:00
7c9f41f98f Merge branch 'blender2.8' into greasepencil-object 2017-11-29 10:38:03 +01:00
2392dc8246 New VFX Flip modifier
This modifier flip horiz. or vertically the current gp object image. The flip works in screen space
2017-11-29 09:36:43 +01:00
47898a5777 Fix rename fields after merge 2017-11-28 16:27:36 +01:00
61f9310bda Merge branch 'blender2.8' into greasepencil-object 2017-11-28 16:16:46 +01:00
7b8e127902 Reuse show_keys_from_selected_only for jump frames
It's better to reuse this option that is already defined by scene.
2017-11-28 14:11:11 +01:00
94efac4297 Add edit point custom shader
The previous shader was not working in some Intel cards, and these commit is to replace with a new shader that works in all card types.
2017-11-28 13:45:05 +01:00
aef88cd76a Fix chnaged lines by error in previous commit 2017-11-28 11:17:29 +01:00
ee157def31 Merge branch 'blender2.8' into greasepencil-object 2017-11-27 17:26:10 +01:00
dde37368ed UI: Change to only selected icon 2017-11-27 17:22:47 +01:00
c29174eedf Dopesheet jump frame in active layer
This new function allows to enable the frame jump only in active layer and not in all visible layer.

This was a request of Hero open movie artist team.
2017-11-27 17:07:45 +01:00
bb72601d89 Merge branch 'blender2.8' into greasepencil-object 2017-11-27 10:12:28 +01:00
3a686cdf24 Merge branch 'blender2.8' into greasepencil-object 2017-11-26 09:22:12 +01:00
fe04bf0800 Use weight in Hook modifier 2017-11-25 16:10:22 +01:00
70e87a7ac1 Change Hook modifier default parameters 2017-11-25 13:53:24 +01:00
9ea7fb3982 WIP: Fix write hook data 2017-11-25 13:47:30 +01:00
9215e2a097 WIP: Hook modifier initial basic stage 2017-11-25 13:36:57 +01:00
fe82a8257a Merge branch 'blender2.8' into greasepencil-object 2017-11-25 11:18:26 +01:00
e37b251d7a Merge branch 'blender2.8' into greasepencil-object 2017-11-24 16:45:14 +01:00
b1035ae3ac Cleanup code 2017-11-24 16:43:57 +01:00
d41095f308 Use theme default grid color 2017-11-24 11:04:15 +01:00
19624c8dd7 UI: Redo paper panel 2017-11-24 10:41:58 +01:00
6f8ee14340 Change color for grid lines 2017-11-24 10:38:53 +01:00
5517049481 Add grid option to grease pencil paper
Default values added too.
2017-11-23 22:37:13 +01:00
e2adbc9bca WIP: New paper function
This function allows to cover full viewport with a predefined color. This allows to hide the geometry in complex scenes and make the drawing area cleaner.

This function was requested by artist after working in Hero open movie using complex scenes with a lot of geometry "behind" of the grease pencil drawings.
2017-11-23 19:54:56 +01:00
8102646a9f WIP: New smooth thickness parameter
These parameters are part of the smooth test and can be removed in the future.
2017-11-23 18:23:27 +01:00
acad042fdf Remove Brush test parameters
After doing some test, remove several parameters added to verify smooth stroke.
2017-11-23 18:23:27 +01:00
Dalai Felinto
3ac2577e86 Merge remote-tracking branch 'origin/blender2.8' into greasepencil-object 2017-11-23 15:05:23 -02:00
5e37797caf Cleanup debug prints 2017-11-24 03:29:55 +13:00
260b747d33 GP Build Modifier: Fix "Concurrent" Mode
The last segment of shorter strokes was always suddenly appearing.
it turns out the at the formulations for those factors was off.
2017-11-24 03:29:55 +13:00
5edb6d437a GP Build Modifier: Rename direction -> transition, and rearrange UI panel 2017-11-24 03:29:54 +13:00
3b4afd5ca1 GP Build Mod Fixes
* Sequential mode now works - Accidentally removed the important tallying
  step when cleaning up the code earlier

* Typo - Was looking for "direction" values in the wrong field
2017-11-24 03:29:53 +13:00
57344862d9 Fix crashes
* Forgot to remove strokes from frame before deleting their data
* Typo - Used old "gps" pointer not "cell->gps"
2017-11-24 03:29:52 +13:00
f43aecba88 GP Build Modifier - RNA + UI 2017-11-24 03:29:52 +13:00
bb090d1acd Show an error message if a GP modifier cannot be applied instead of failing silently 2017-11-24 03:29:51 +13:00
47c9dda076 GP Build Modifier: Initial WIP implementation of this modifier
It's likely that there are still many bugs here, so caution is advised.
2017-11-24 03:29:50 +13:00
05f5dc14a0 Partially revert rBc038bbbce2b 2017-11-24 03:28:11 +13:00
Dalai Felinto
7c7ab48dec Remaining warning in grease pencil 2017-11-23 10:50:45 -02:00
Dalai Felinto
9f47ddeb8a Merge remote-tracking branch 'origin/blender2.8' into greasepencil-object 2017-11-23 10:49:58 -02:00
Dalai Felinto
a6d584fc46 Merge commit '3abe8b3292cf7a50a9200b95401993384df24d9a' into greasepencil-object
Note: Since grease pencil had its own subversion, and this merge brings 2.80
subversion 2 as well, the files should be saved BEFORE this commit, to be sure
that all the doversion happened.
2017-11-23 10:44:51 -02:00
Dalai Felinto
fd9407ada5 Merge commit '3abe8b3292cf7a50a9200b95401993384df24d9a^' into greasepencil-object 2017-11-23 10:20:44 -02:00
Dalai Felinto
c038bbbce2 Silence warnings
Please keep the code warnings-free as much as possible.
2017-11-23 10:17:22 -02:00
2a47ede614 UI: Add buttons at bottom bar
Add Only Render and Lock Camera View options to bottom toolbar because use the options in panels break the drawing workflow and use a lot of space in the drawing area.
2017-11-22 19:11:51 +01:00
c9c8bfdba1 Fix error after merge 2017-11-22 19:00:24 +01:00
b24034544c Merge branch 'blender2.8' into greasepencil-object 2017-11-22 18:50:53 +01:00
7fee462be0 Merge branch 'blender2.8' into greasepencil-object 2017-11-22 16:31:49 +01:00
59f1f76151 Merge branch 'blender2.8' into greasepencil-object 2017-11-21 10:22:19 +01:00
a5995d8161 Move BKE_gpencil_batch_cache_alldirty()'s debug value to 66
This Makes it possible to set this without seeing all the stats in the way
2017-11-21 12:17:08 +13:00
6c7bd14ac3 Cleanup - This code shouldn't be needed anymore 2017-11-21 12:17:07 +13:00
a666a5d016 UI: Rename MultiEdit to MultiFrame 2017-11-20 19:12:52 +01:00
df9b547323 Merge branch 'blender2.8' into greasepencil-object 2017-11-20 10:42:27 +01:00
48bb9e1697 Merge branch 'blender2.8' into greasepencil-object 2017-11-19 15:53:39 +01:00
23d820c240 Cleanup include files 2017-11-17 16:38:33 +01:00
9a6be73429 Fix merge error
VS2017 crash in the midle of the merge process and created wrong git tag lines
2017-11-17 16:29:01 +01:00
b3a0b423a6 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/draw/intern/draw_cache_impl.h
2017-11-17 16:27:55 +01:00
ff6e2e82ea Fix: Crash when moving GP frame so that it replaces the one before it
This crash only occurred in a particular file, when onion skinning was
enabled. For some reason, the fact that this function was clearing the
layer's actframe (when the frame being deleted wasn't currently active)
was causing problems. I'm guessing that the GP draw engine code currently
assumes that gpl->actframe will always be set/valid?
2017-11-18 02:46:29 +13:00
a9482038ed Merge branch 'blender2.8' into greasepencil-object 2017-11-16 18:48:29 +01:00
d9d5166953 Merge branch 'blender2.8' into greasepencil-object 2017-11-16 14:35:15 +01:00
d772b1d934 Fix crashes when loading old GP files from 2.79
Moved all the datablock-twiddling version patching magic to the
"after_liblink" version patching function. Apparently the problem
was that many of the old pointers had not been fixed up at that point,
causing problems if relying on accessing their contents.
2017-11-17 01:16:40 +13:00
d482857965 Merge branch 'blender2.8' into greasepencil-object 2017-11-15 19:31:48 +01:00
815c00270c WIP: Create SceneLayer if missing 2017-11-15 17:24:53 +01:00
b4f08d135b Change texture format
Due draw manager changes, the texture must be DRW_TEX_DEPTH_24_STENCIL_8 instead of DRW_TEX_DEPTH_24
2017-11-15 09:47:45 +01:00
b7efe91893 Merge branch 'blender2.8' into greasepencil-object 2017-11-15 14:33:01 +13:00
e6a0b442c7 Enable antialiasing while drawing
The antialiasing was not activated for previous strokes, only for current.
2017-11-14 16:04:41 +01:00
8c5bff94d1 Fix: Temporary fix for crashes when moving GP keyframes when toggling Onion Skinning
ANIM_list_elem_update() was not doing anything as ale->id was null,
and we were filtering the channels by "animdata" blocks (i.e. the GP
datablocks). While technically what we're doing here isn't totally
correct (I'll need to come up with a better fix tomorrow), this will
be a good quick-fix for the crashes they animators are currently getting.
2017-11-15 02:57:01 +13:00
8c07cf1385 Fix compile errors after merge 2017-11-14 23:49:55 +13:00
8119b65b86 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/versioning_280.c
2017-11-14 23:49:51 +13:00
715c58d6bf Cleanup: Remove unused code 2017-11-14 09:53:38 +01:00
28142f5fa5 WIP: More work in smooth process 2017-11-13 19:31:40 +01:00
0dc9be1ef9 Fix merge errors 2017-11-13 19:13:12 +01:00
c03361474b Merge branch 'blender2.8' into greasepencil-object 2017-11-13 19:02:50 +01:00
0b7c2ef28b Smooth Strength and Thickness too 2017-11-13 18:12:52 +01:00
aaed57792f Improve subdivide stroke while drawing
Now instead of create a point half way, a smooth process is applicated.
2017-11-13 17:58:58 +01:00
5819ab66fa WIP: Check minimum tablet pressure
In some tablets when the user ends the stroke the tablet send several events with a pressure of 0 or with very low values. These low pressure values produce weird lines at the end of the stroke.
2017-11-13 16:45:33 +01:00
330febba5a Cleanup UI and unused fields 2017-11-13 14:35:14 +01:00
8b97a539aa New Smooth modifer
Allow to apply smooth to the stroke after drawing.

This is not related to the smooth of the stroke while drawing.
2017-11-13 11:01:44 +01:00
98cf19c7ed Cleanup extra space 2017-11-11 19:12:14 +01:00
541d7415bf WIP: Remove smooth lower limit
These lines were for debug only and must be removed
2017-11-11 18:55:11 +01:00
4126de5114 Fix merge errors
The ruler was using old grease pencil structure and palettes.

This need more attention in the future.
2017-11-11 16:35:17 +01:00
1d8b9681fe Merge branch 'blender2.8' into greasepencil-object 2017-11-11 16:16:41 +01:00
333e32e0e1 WIP: Smooth Thickness and Strength
This mooth the thickness of the strokes using points before and after. The same for strength (alpha)

Some cleanup too.
2017-11-11 16:13:55 +01:00
42b43925fb Fix error in previous commits 2017-11-10 20:12:11 +01:00
4cb437d42f WIP: Readjust smooth thickness weights 2017-11-10 20:10:21 +01:00
c5131c95e7 WIP: Readjust weight for stabilize 2017-11-10 20:09:36 +01:00
fce610eeed WIP: First test for smooth thickness 2017-11-10 20:08:51 +01:00
cbd15d1452 WIP: More work to get better drawing feeling
Thre was some problems in previous commits
2017-11-10 19:14:58 +01:00
6d272e612e Remap pixel scale parameter
The value for control point density was strange.
2017-11-10 09:00:06 +01:00
7bf104abd7 Compile fixes after merge 2017-11-10 12:39:28 +13:00
5354c80037 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/blenloader/intern/readfile.c
	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
	source/blender/draw/modes/object_mode.c
	source/blender/editors/include/ED_gpencil.h
	source/blender/editors/space_view3d/view3d_draw_legacy.c
2017-11-10 11:43:38 +13:00
464eb5b042 Cleanup: Fix compiler warnings 2017-11-09 19:29:57 +01:00
ff13b291b0 Cleanup: Supress compiler warning 2017-11-09 19:23:58 +01:00
526e2291ff WIP: New parameters for brushes
More parameters to define how the stroke is stabilized.

This parameters maybe are not necessary on UI, but we need them now for testing different values.
2017-11-09 16:41:10 +01:00
712c3a86ed WIP: Fix error in smooth lines
Need to check the distance of previous points, not new with previous.
2017-11-09 12:46:22 +01:00
a73f098668 WIP: Reduce points when stroke is slow
Initial work to reduce the noise when the stroke is done very slow removing points not relevant.
2017-11-09 11:50:51 +01:00
6484646103 Merge branch 'blender2.8' into greasepencil-object 2017-11-09 19:34:42 +13:00
e7a016d368 Fix compiler error 2017-11-08 08:52:52 +01:00
f1b0d3f349 Merge branch 'blender2.8' into greasepencil-object 2017-11-08 08:37:32 +01:00
23981fad45 WIP: As a temporary measure for fixing GP cache invalidation crashes,
re-enable BKE_gpencil_batch_cache_alldirty_main() when debug_value = 660
2017-11-08 14:15:53 +13:00
ab83695711 Updating the hacky eval_ctx construction to use more official functions 2017-11-08 13:22:54 +13:00
7b9595d366 Fix: Added some more tags/relations in depsgraph to fix crashes when Onion Skinning is enabled
* id_tag_update_object_data() - Added a case for the GP datablock type
  so that depsgraph tagging via the GPencil datablock's RNA properties
  works. Previously, only the object.data case (i.e. modifiers) was handled.
  This fixes a crash when enabling onion skinning, and a ghost can be shown
  on the neighbouring frames.

* DepsgraphRelationBuilder::build_obdata_geom() - Added a relation between
  timesource and GP geometry (i.e. where cache rebuild occurs). This fixes
  a crash after scrubbing the timeline when onion skinning is enabled
  (I'm guessing due to onion skinning suddenly getting re-shown, but the cache
  not doesn't contain this info due to the previously being updated for animation)
2017-11-08 13:22:25 +13:00
fa3c3438a2 Apply stabilization in segments with a minimum size
If the points are too near, the stabilization must be disabled.

This modification is still WIP, needs more artist feedback to verify if works.
2017-11-07 18:34:40 +01:00
94a3f0f089 Merge branch 'blender2.8' into greasepencil-object 2017-11-07 16:15:44 +01:00
98556dc965 Improve stabilization function
Now the previous point is smoothed too to get a better transition.
2017-11-07 16:12:35 +01:00
2a86495125 Improve thickness fix when no locked axis
There was some problems with the thickness when the axis was not locked that were not fixed in previous commit.
2017-11-07 13:46:09 +01:00
82eaf7a13d Merge branch 'blender2.8' into greasepencil-object 2017-11-07 12:30:25 +01:00
53822bd1d7 Fix error when axis not locked
The size of the stroke was not correct when the axis was not locked.

It needs a vector to the view to calculate the real size of the stroke.
2017-11-07 11:58:22 +01:00
9fc8ec1817 Redo Fix in previous commit and add missing lines 2017-11-07 11:30:21 +01:00
30cfbec6e2 UI: Remove deprecated property
The OBJECT mode was removed as property.
2017-11-07 11:08:30 +01:00
e19e686edb Merge branch 'blender2.8' into greasepencil-object 2017-11-07 10:44:43 +01:00
a051c2e870 New parameter to adjust stabilization
Parameter to control the stabilization amount of the brush.

This stabilization works as a dynamic smooth using the previous points to calculate the estimated position and average the position to get smoother strokes.

This is not a replace of smooth factor that works after finish stroke. This new parameter is applyed while drawing before ending the stroke.
2017-11-07 10:43:55 +01:00
e176d66cbe Fix: Depsgraph was complaining in debug mode about the "geometry_eval" opnode for GPencil not having any function attached
In future, maybe we should move the derived_gpf calculations
(and by extension, the modifier-evaluation loops) into the
BKE_gpencil_eval_geometry() callback added in this commit.
2017-11-07 20:51:54 +13:00
806aa232fe WIP 2017-11-07 19:41:53 +13:00
03235ea672 GP drawing: Try to init the eval_ctx from draw_ctx, if C isn't provided 2017-11-07 19:41:52 +13:00
866c4a881d Fix merge errors 2017-11-06 18:56:55 +01:00
fdf0191d78 Merge branch 'blender2.8' into greasepencil-object 2017-11-06 18:44:25 +01:00
92a3028e92 Merge branch 'blender2.8' into greasepencil-object 2017-11-06 17:47:18 +01:00
51ca8f81ed Fix problem after merge
One BKE function used changed
2017-11-06 17:17:19 +01:00
a66cae8737 Merge branch 'blender2.8' into greasepencil-object 2017-11-06 16:56:51 +01:00
e2a18af69d Smooth new points while drawing
A new smooth algorithm is used for each new buffer point using the last two points to calculate the estimated position and average this point with the current mouse position.

This smooth reduce the jitter of the stroke and allows to use lower post smooth values to reduce stroke change after finish stroke.

Now the factor is hardcoded, but after some more testing maybe we need add a parameter by brush.
2017-11-06 16:55:50 +01:00
e45633335a Merge branch 'blender2.8' into greasepencil-object 2017-11-05 16:37:06 +01:00
204db92965 Merge branch 'blender2.8' into greasepencil-object 2017-11-04 16:33:08 +01:00
67b74e5352 Fix delay cleaning previous frame when drawing
The fast drawing was not cleaning the previous frame when the artist create a new one and only was redraw after release mouse.
2017-11-04 16:31:56 +01:00
8432097669 Fix crash on trying to save files with GP objects
Quick fix for context being NULL when the thumbnail renderer gets triggered
while trying to save files.

TODO: We need a better solution here for passing eval_ctx down to GP modifiers
2017-11-05 00:23:02 +13:00
2290a4e8ed Fix: Pass a usable EvaluationContext to GP Modifiers
This is needed for some modifiers (e.g. Build), which rely on time
2017-11-04 21:55:39 +13:00
12074daebc Fix: Alt-Shift-SelectMouse wasn't working to add an entire stroke to the current selection 2017-11-04 18:23:31 +13:00
53238de132 GP Object: Added missing support for the "Apply Transforms" operators 2017-11-04 17:43:48 +13:00
cde66cdfc5 Cleanup: Style fixes 2017-11-04 17:43:48 +13:00
1559771cb6 Pre-emptive fixes for crashes occurring when GP strokes have no palette/color info assigned 2017-11-04 17:43:47 +13:00
02e3eb1ee7 Fix: Crash when unhiding a GP layer in the dopesheet if the frame has changed in the meantime 2017-11-04 17:43:47 +13:00
c355869cb1 Cleanup: Remove a whole bunch of manual GP cache tagging (marked for review) 2017-11-04 17:43:46 +13:00
4c542f6c37 Fix: Added "missing link" preventing depsgraph id_tag getting to GPencil updates
This was causing problems like making the modifier show/hide button not
work for Grease Pencil objects
2017-11-04 17:43:45 +13:00
c706a78683 GP Modifiers: Finish porting over last modifier (Simplify) and Cleanup Code 2017-11-04 17:43:45 +13:00
f5852bedde Cleanup: Use vec2f instead of defining our own 2d point type 2017-11-04 17:43:44 +13:00
583b871ec7 Cleanup: Ported Lattice Modifier code over to new callbacks 2017-11-04 17:43:44 +13:00
7db53c109e Outliner: Indicate which GP layer is active
Active layers get the colored pencil, while inactive ones get the dot
2017-11-04 17:43:43 +13:00
4b4bb0c838 Outliner now displays icons for GP Modifiers 2017-11-04 17:43:42 +13:00
df289455c7 GP Modifiers: Replace defunct "Duplication" modifier with "Build" modifier
It doesn't actually do anything now, and most of its properties are
undefined as well, but we don't want to break any existing files now
(as renumbering the other modifiers would cause issues)

Note: BKE_gpencil_reset_modifiers() has been removed. If the array modifier
needs this, we will have to find another solution to this.
2017-11-04 17:43:42 +13:00
a88cdce5db Fixes to various GP Modifiers
* Array modifier can be shown in editmode
  (TODO: When "Make Objects" is enabled, this breaks)

* Color (hue/sat) modifier was still using G.main
  -> Updated to use palette slots instead
2017-11-04 17:43:38 +13:00
bac4029926 Fix: Inconsistent behaviour between different GP array modifier cases
The main culprits here were:
1) Wrong order of matrix multiplication (resulting in inverted grid layout)

2) Directly reading off diagonals from matrix as scale, which failed when
   objects were rotated
2017-11-04 17:43:38 +13:00
cbe0626e8e Cleanup: Remove a bunch of redundant/bad old code 2017-11-04 17:43:37 +13:00
442d3f2697 GP Array Modifier: Bring back draw-engine hack for array modifier drawing
This time, it only runs when "Make Objects" is enabled on a modifier,
giving users a workaround for the z-ordering problems.
2017-11-04 17:43:36 +13:00
4311de9d86 Fix UI breakage (GP Modifiers / 3D View header) after ob->gpd --> ob->data refactor 2017-11-04 17:43:36 +13:00
1d27ca9be3 Fix: GP Modifiers UI was broken during the ob->gpd --> ob->data refactor 2017-11-04 17:43:35 +13:00
bb1475053e Fix: GP array modifier's "count" property should have a lower "sane" limit
Previously, the upper bound for dragging in the UI was effectively unlimited.
This has the unfortunate consequence of causing hard resets (out of bounds/memory)
as I found out last night while testing this.
2017-11-04 17:43:35 +13:00
b7ad3ea653 GP Modifiers - Merge Array and Duplication modifiers
Array and Duplication modifiers basically implemented the same functionality,
except that:
1) Array was slightly more powerful (i.e. it could make a 3D grid instead of
   just putting everything in a single line), and
2) Array created new objects when "Applying", while Duplication added to the
   current datablock

This commit basically merges the functionality of both into the Array modifier.
I ended up recoding this modifier to hopefully work a lot faster.
* The resulting modifier more closely resembles the behaviour of the normal
  Blender Array modifier.
* Performance should be better now with over 25 objects (previous array modifier
  implementation lagged badly with more than 25-30 instances). The previous approach
  of manually creating objects didn't work too well.

TODO:
* The functionality to disable the instance creation when the simplify options
  are enabled is currently lost. Still need to figure out how to restore it
* The stubs/shell for the old Duplication modifier are still around. To be removed!
2017-11-04 17:43:34 +13:00
cc9eb7b26c Restored manual gpencil_batch_cache_dirty() call when adding modifiers
There are too many problems leaving it out, even if in theory the depsgraph
calls should be taking care of it.
2017-11-04 17:43:33 +13:00
52edc1a9c6 Port Subdiv GP Modifier 2017-11-04 17:43:33 +13:00
b19021ecfa Temporary (?) fix so that Hero project files get version patched correctly 2017-11-04 17:43:32 +13:00
32e49c732b Porting more GP Modifiers
* Opacity modifier
* Color modifier
* Thickness modifier
* Tint modifier
2017-11-04 17:43:31 +13:00
abf0f70296 Cleanup: Remove unused function 2017-11-04 17:43:31 +13:00
0fdfff51d9 Fix: GP modifiers not updating when properties changed
Added back an explicit call to BKE_gpencil_batch_cache_dirty()
in the rna update callback for GPencil modifier properties.

However, instead of polluting the general rna_Modifier_update(),
this time we do this in a special wrapper/update callback for
dedicated GP modifier usage.

I'm unsure why the depsgraph isn't properly updating this case
- there's probably a missing relation between modifier properties
and GP ubereval (which calls the tagging), but where?!
2017-11-04 17:43:30 +13:00
30780a4238 GP Modifier: Set up stubs for geometry modifiers too 2017-11-04 17:43:29 +13:00
b05b0900d3 GP Modifiers: Fully ported Noise modifier over to new system 2017-11-04 17:43:29 +13:00
0ca86c6ab5 Fix: "deformStrokes(..., bGPDframe *)" callback should really have been "deformStroke(..., bGPDstroke *)" instead 2017-11-04 17:43:28 +13:00
88972d1698 Cleanup - Various cleanups for GP modifier files
* Remove redundant checks
* Use M_PI_2 instead of hardcoding a magic number
* Fix license text year info
* Properly handle new palette creation in Tint modifier
2017-11-04 17:43:27 +13:00
9e1685cb13 Cleanup: De-duplicate mode checking macros for GPencil 2017-11-04 17:43:27 +13:00
8b18d7a51e Cleanup - Use existing vertex groups function instead of defining out own 2017-11-04 17:43:26 +13:00
217c58917c Cleanup - Move helper functions for GP modifiers into the modifiers module 2017-11-04 17:43:26 +13:00
68e00c852f Fix compiler warning about const vs non-const 2017-11-04 17:43:25 +13:00
1d9a8be513 Fix "Apply Modifier" operator to use the new callbacks 2017-11-04 17:43:24 +13:00
26efbf16b6 GP Modifiers - Change all applyModifier callbacks to bakeModifierGP callbacks 2017-11-04 17:43:24 +13:00
7163e8c190 ModifierTypeInfo - Add 3 dedicated callbacks to support GP modifier evaluation and operations
* deformStrokes - Handles the "stroke" modifiers currently evaluated in
                  BKE_gpencil_stroke_modifiers() - e.g. Thickness, Noise

* generateStrokes - Handles the "geometry" modifiers currently evaluated
                    in BKE_gpencil_geometry_modifiers() - e.g. Array

* bakeModifierGP - Dedicated callback for hosting the code currently
                   wrongly-placed in applyModifier. This gets called
                   when pressing the "Apply" button on a GP modifier.
2017-11-04 17:43:23 +13:00
a16f60ad44 Compile fix: Missed a reference in previous commit
TODO: Calls to BKE_gpencil_layer_delframe() need to trigger a refresh
2017-11-04 17:43:22 +13:00
96e607f017 Cleanup: Eliminate BKE_gpencil_batch_cache_alldirty()
This accessed the global G.main directly, which we're trying to remove
2017-11-04 17:43:21 +13:00
61c129b57e Cleanup - Remove direct BKE_gpencil_batch_cache_dirty() code in favor of depsgraph tagging 2017-11-04 17:43:21 +13:00
49b8f73715 Fix: Version patching code was creating extra GP datablocks and throwing them away
After modifying the BKE_object_add() function to create a new GP datablock
by default, this change in behaviour would cause problems for the version
patching code fixing the old scene->gpd.
2017-11-04 17:43:20 +13:00
b3a4b8ec47 Cleanup - Style 2017-11-04 17:43:19 +13:00
346699bc9f Cleanup - Remove unused var 2017-11-04 17:43:19 +13:00
99d13d1c65 Cleanup: Remove the redundant GP_TOOL_SOURCE_OBJECT stuff
Since we only have GP objects in the 3D view now, this is the only
setting that should be used. Therefore, there's no need to set this
setting or check if for any reasons anymore.
2017-11-04 17:43:18 +13:00
1346ab8d98 Cleanup: Use standard logic for duplicating OB_GPENCIL objects and their data 2017-11-04 17:43:17 +13:00
b95b48f149 Fix: GP objects should get created with GP datablocks initialised already
(just like all other object types)

Previously, because the GP datablock was stored in a different place,
this had to be handled differently from other datablocks. But that
doesn't hold anymore, so it's time to fix that.
2017-11-04 17:43:17 +13:00
2aa87cdf67 Make BKE_gpencil_data_addnew() accept Main as an argument instead of using G.main 2017-11-04 17:43:16 +13:00
c109b5e59d Fix: Remove temporary debugging prints 2017-11-04 17:43:16 +13:00
66df7d9b74 Fix: Remove most of the code for treating GP as a special case in the vertex group poll functions
These were causing crashes on GP datablocks with ob->data not set
when clicking on the Vertex Groups panel (i.e. as the operator lookups
would cause problems)
2017-11-04 17:43:15 +13:00
e56a139e02 Fix typo causing crashes when trying to draw GP objects 2017-11-04 17:43:14 +13:00
f834845de0 Fix: Properties Editor was still showing the datablock selector for the old Object.grease_pencil 2017-11-04 17:43:14 +13:00
de2cafef29 Fix: Some more sanity checks for cases not handled 2017-11-04 17:43:13 +13:00
e1023560df Fix crashes on startup 2017-11-04 17:43:12 +13:00
faf93e0cc6 Fix some missed ob->gpd references 2017-11-04 17:43:12 +13:00
70380ef188 Fix typos and crash on startup 2017-11-04 17:43:11 +13:00
6c75e0c33b WIP Temporarily knock out some of the bad modifier/update hacks being used
These will hopefully be removed after some more testing, but in the meantime,
just commenting them out to test if things work still.
2017-11-04 17:43:10 +13:00
04e439513b GP Branch: Use ob->data instead of ob->gpd for storing GP object's GPencil datablock
WARNING: Old files created in the GP branch may break after this commit!

* There won't be data loss, but it will be necessary to manually fix this
  per-file as needed. The old ob->gpd pointer remains for now to ease the
  transition.

* The code will attempt to version patch old files that store data in this
  pointer. However, right now, this only works for GP Objects and for Empties.
2017-11-04 17:43:10 +13:00
7ca4c512a7 Hacky WIP code to verify that GPencil-Dopesheet Integration (for modifiers) is working
This code should be replaced, as it currently just duplicates the
modifier-looping logic (bad!). However, this is just a temporary placeholder
needed to get the updateDepsgraph() calls to run at all.

In any case, this would've been easier if I'd done the ob->gpd ==> ob->data
fixes first, since this hack wouldn't be needed.
2017-11-04 17:43:09 +13:00
b5c994cd72 Make GP cache tagging happen in the BKE_object_eval_uber_data callback 2017-11-04 17:43:08 +13:00
8b4d22db99 GP Lattice Modifier - Define updateDepsgraph() callback to add needed relations
and remove manula updates
2017-11-04 17:43:08 +13:00
ed612d9ed5 Knock out old "tag all" functions so that we can check if everything is working properly 2017-11-04 17:43:07 +13:00
e42adf6fc3 Merge branch 'blender2.8' into greasepencil-object 2017-11-03 17:44:44 +01:00
abaab202f9 Merge branch 'blender2.8' into greasepencil-object 2017-11-02 15:44:28 +01:00
af421a45e6 Merge branch 'blender2.8' into greasepencil-object 2017-11-01 09:33:31 +01:00
b381e84ec3 Merge branch 'blender2.8' into greasepencil-object 2017-10-30 09:25:35 +01:00
eb1d7a9ba7 Merge branch 'blender2.8' into greasepencil-object 2017-10-28 10:54:28 +02:00
b229e65eb7 Merge branch 'blender2.8' into greasepencil-object 2017-10-26 13:11:43 +13:00
37168c76fe Merge branch 'blender2.8' into greasepencil-object 2017-10-25 23:52:10 +13:00
55b4f89539 Merge branch 'blender2.8' into greasepencil-object 2017-10-25 12:37:41 +13:00
e4369b6663 Merge branch 'blender2.8' into greasepencil-object 2017-10-24 19:35:12 +02:00
3083a9c05e Fix memory leak in GPU
The problem was the flag was not checked and in some situations this avoided the batch clear.
2017-10-24 19:26:59 +02:00
41025e1550 Fix: GP-related menus were only available in "Edit Mode" but not any of the other modes
Instead, the Object Mode menus were being shown, which could be quite confusing
and useless in general.
2017-10-25 00:56:11 +13:00
2c71b7ec6c Code Cleanup - Fix name of helper function to be less misleading 2017-10-25 00:56:11 +13:00
007b43dcb3 Fix more issues raised in code review 2017-10-25 00:56:10 +13:00
06fb27296a Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object 2017-10-24 13:45:54 +02:00
5cb7cc4939 Fix after merge error 2017-10-24 13:45:31 +02:00
c541a58928 Merge branch 'blender2.8' into greasepencil-object 2017-10-24 13:35:51 +02:00
bf390d5748 Code Cleanup - Style, indentation 2017-10-24 21:25:00 +13:00
bc283c2e4f Code Cleanup - Simplify code here based on issues raised in code review 2017-10-24 21:07:38 +13:00
Dalai Felinto
76772f29f4 Merge remote-tracking branch 'origin/blender2.8' into greasepencil-object 2017-10-23 18:42:55 -02:00
Dalai Felinto
17c92b96af Merge remote-tracking branch 'origin/blender2.8' into greasepencil-object 2017-10-23 18:06:40 -02:00
746380bbc5 Replace loop index to post addition 2017-10-23 20:44:57 +02:00
51e3735653 Fix wrong allocation
The allocation was allocating batches, but must be an array of pointers to batches.
2017-10-23 20:09:53 +02:00
6f7eecc47b Remove uses of BKE_gpencil_batch_cache_alldirty() 2017-10-23 15:58:24 +02:00
b61e158d90 Remove more G.main uses 2017-10-23 12:14:43 +02:00
2ebe4da826 Remove G.Main from RNA code
Remove the use of global main in RNA functions
2017-10-23 12:09:55 +02:00
15a84215da Merge branch 'blender2.8' into greasepencil-object 2017-10-23 10:45:10 +02:00
991bb5b567 Fix Thickness curve intialization error
When reload file, the curve was not initializated and produces segment fault.
2017-10-22 10:56:03 +02:00
20da47b003 Cleanup: use relative imports in bl_ui
More changes missing in previous merge
2017-10-21 17:50:43 +02:00
a0673038ab Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/properties_scene.py
        release/scripts/startup/bl_ui/space_clip.py
	release/scripts/startup/bl_ui/space_image.py
	release/scripts/startup/bl_ui/space_node.py
	release/scripts/startup/bl_ui/space_view3d.py
	release/scripts/startup/bl_ui/space_view3d_toolbar.py
2017-10-21 17:36:18 +02:00
f64c881f58 Fix merge error
In a previous merge, this file was wrong.
2017-10-21 09:26:11 +02:00
b1d6f6e3c3 Cleanup: Remove unused code 2017-10-20 19:39:35 +02:00
0fa2873c5d Pass bmain explicitly rather than via bContext
Passing main makes function easier for re-use.
2017-10-20 19:33:52 +02:00
c8a9df6a2c Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/gpencil/drawgpencil.c
2017-10-20 19:21:02 +02:00
72babc41b0 Cleanup style 2017-10-20 19:17:47 +02:00
52cb675171 Cleanup style and variable names 2017-10-20 19:09:39 +02:00
dec99c6b68 Cleanup style 2017-10-20 19:03:35 +02:00
6528b0b169 Cleanup style 2017-10-20 19:00:54 +02:00
227ddeb435 Cleanup: Replace duplicated poll lines by function 2017-10-20 18:53:22 +02:00
082b32c53a Rename texture_shift to texture_offset 2017-10-20 18:32:58 +02:00
ff756fb902 CMake: Fix order of libraries to address linking errors on Linux 2017-10-20 15:26:27 +02:00
6e203baa54 Cleanup: Use modifier scene 2017-10-20 10:07:27 +02:00
68efeb2066 Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object 2017-10-20 10:03:20 +02:00
dc43067cae Cleanup: Rename passindex to pass_index 2017-10-20 10:03:00 +02:00
5b40247dda Cleanup: redundant casts 2017-10-20 13:31:47 +11:00
0ff23fd671 Merge branch 'blender2.8' into greasepencil-object 2017-10-20 12:48:58 +11:00
6aeb92ac95 Fix draw on parented object
When the gp object was parented, the location was not using obmatrix and the position was wrong.
2017-10-19 17:09:38 +02:00
699a88c06e Cleanup: Add end line 2017-10-19 16:29:16 +02:00
631a267fa8 Reorganize shgroups creation
Improve the creation of shading groups and fix some memory leaks when the shading group was created but not used in any pass.
2017-10-19 15:58:43 +02:00
ac3ce46e1e Merge branch 'blender2.8' into greasepencil-object 2017-10-20 02:11:35 +13:00
cddbe11bee Minor RNA tweaks for MultiEdit
* Rename RNA properties to bring them more in line with standard naming
* Make it clearer in the tooltip for MultiEdit that only selected keyframes
  will be edited
2017-10-20 02:05:53 +13:00
8d9c1f03da Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	release/scripts/startup/bl_ui/space_view3d.py
2017-10-19 19:15:15 +13:00
ac521fc0bf Refresh gp cache while transform
The geometry cache must be recalculated when move keyframes in action editors.
2017-10-18 17:38:44 +02:00
e6dc574f9a Merge branch 'blender2.8' into greasepencil-object 2017-10-18 16:45:51 +02:00
36e5d42d1d Version bump to 2.80.2 and initialization code
As Grease Pencil branch is developed using 2.80 as base, it's necessary to bump the version and move all initialization code to keep running all Hero open movie files that were created with GP branch.
2017-10-18 16:38:48 +02:00
3057a6d6cf Fix after merge errors 2017-10-18 10:47:36 +02:00
a038fa5d40 Merge branch 'blender2.8' into greasepencil-object 2017-10-18 10:19:42 +02:00
1eafff4bf1 Merge branch 'blender2.8' into greasepencil-object 2017-10-18 19:06:15 +13:00
44c7411220 Remove unused code
Turns out this chunk of code won't get run at all (since GP objects
store the GP datablock on the ob->gpd pointer and not ob->data like
every other object type).
2017-10-18 13:28:54 +13:00
6a7bf3b058 Set cache as dirty in Dopesheet
After a transformation, the cache must be set as dirty.
2017-10-17 17:29:54 +02:00
c8071080e9 Redo previous commit for Join
If the weight memory is not duplicated, when the initial stroke is released the memory can get corrupted.
2017-10-17 16:19:48 +02:00
08e3f32bb0 Fix segment fault when join
The join strokes operator did not copied the weights and this resulted in segment fault.
2017-10-17 12:49:51 +02:00
01e77ef532 Cleanup: warnings 2017-10-17 16:26:07 +11:00
7031f9672a Merge branch 'blender2.8' into greasepencil-object 2017-10-17 16:19:48 +11:00
833a2855fe Merge branch 'blender2.8' into greasepencil-object 2017-10-17 16:17:46 +11:00
4e33a12185 Merge branch 'blender2.8' into greasepencil-object 2017-10-17 16:07:48 +11:00
8c10596c19 Restore part of comment for xray_mode, left out during earlier fix 2017-10-17 14:56:59 +13:00
b2a3df653e Remove last_palette_name field
This isn't used for anything anymore. Removing it (and the padding) doesn't
seem to cause any new glitches, so this should be ok.
2017-10-17 14:56:28 +13:00
cfc11c5e4a Code Cleanup - Remove all uses of gpd->last_palette_name
The reason for this has been superseeded by the Palette Slots system
2017-10-17 01:03:37 +13:00
feadd7651c Merge branch 'blender2.8' into greasepencil-object 2017-10-16 12:47:29 +02:00
bf2287a036 Fix typo error 2017-10-16 12:37:39 +02:00
5c3dcad7f3 New Select Alternate operator
This operator allows to select alternative points in a selected stroke. This can be useful to disolve or modify.
2017-10-16 12:33:51 +02:00
07ec03d4f8 Rename Panel Primitives to Shapes
The "Primitive" name can be confusing. It's better to use "Shapes" because these options are to add new strokes with a predefined shape, not a new GP object with this shape.
2017-10-16 09:33:23 +02:00
2803d7c06f Update cyclic logic in old draw methods
The first adjacency point must be equal to last one if cyclic enabled.
2017-10-16 08:43:21 +02:00
f7a7a89039 Improve cyclic join
The join of the first point was not perfect.
2017-10-15 19:27:35 +02:00
a99411a1aa Fix cyclic wrong opacity
When enable stroke cyclic, the opacity of the final segment of the stroke was darker.

The problem was related to the adjacency points used.
2017-10-15 18:33:41 +02:00
1363002b57 Rectangle and Circle primitives
Completed the work to create rectangles and circles.
2017-10-15 17:51:28 +02:00
9dddefcbae WIP: Basic rectangle primitive
Still pending to show the feedback ghost image while create the primitive.
2017-10-15 13:31:38 +02:00
d27fa507d5 Cleanup: Remove unused code 2017-10-14 11:54:28 +02:00
5c939d58ef Merge branch 'blender2.8' into greasepencil-object 2017-10-14 11:28:14 +02:00
d62dde9a73 Cleanup: Change debug code
No functional changes.
2017-10-14 11:25:47 +02:00
d55b5603f5 Fix casting to bool before checking the flag 2017-10-14 04:35:54 +11:00
d07f2b12c3 Cleanup: style 2017-10-14 04:32:32 +11:00
df2e134d33 Merge branch 'blender2.8' into greasepencil-object 2017-10-12 17:13:39 +02:00
37b04f1aa5 Fix error selecting camera
The edit shgroup creation must check active object to verify if it's a OB_GPENCIL
2017-10-12 17:10:43 +02:00
7cb871a380 Check object type 2017-10-12 13:09:18 +02:00
c803ed9b80 Fix zdepth order with 3D objects
When draw a new stroke, the stroke must be visible over all 3D objects and not in back of them.

A new mix pass has been created to make a mix with default framebuffer using a gl_FragDepth = 0.0 to force to be in front .
2017-10-12 12:33:35 +02:00
8cae0736fe Check drawing mode flag 2017-10-12 11:55:46 +02:00
d76b27e766 Fix bug of memory corruption
The strokes were transparent and zdepth was doing weird things when using 2 GP objects. This error was introduced by commit: 27/09/2017 08:34 5c8e1dfc28

The problem was the field xray_mode. If move below in the struct, the value is corrupted and draw manager does not work fine..
2017-10-12 11:28:18 +02:00
32322044a0 Fix PaletteSlot memory leak 2017-10-11 20:41:43 +02:00
c82ddb7549 Merge branch 'blender2.8' into greasepencil-object 2017-10-11 10:26:08 +02:00
895ec88857 Set default framebuffer
After detach textures must set the default buffer again.

Also checked the number of samples, not only framebuffer.
2017-10-11 09:58:10 +02:00
1e250b1b83 Fix opacity change when drawing
When draw a stroke with a color with opacity < 1.0, there was a opacity change when finish stroke.

This was related to the blend pass that was used, so the drawing in fast mode must pass through the temp framebuffer to get same alpha values in blend.
2017-10-10 18:49:53 +02:00
f3d3579751 New MSAA macros
Define macros for cleanup code.
2017-10-10 18:41:06 +02:00
7efb8f5477 Cleanup: Remove redundant code 2017-10-10 12:32:42 +02:00
b8161bd9af Fix error introduced in previous commit
The macro used was wrong
2017-10-10 11:19:51 +02:00
4cec3f3ccd Merge branch 'blender2.8' into greasepencil-object 2017-10-10 11:14:00 +02:00
89105e2556 Initialize selection alpha
There is a problem with this value for old 2.7x files, so the value is set to 1.0 when the file is from previous versions.

The initialization is done in weighttype section because this is a safe checking for old files and it is a related parameter.
2017-10-10 11:10:50 +02:00
5c2ee58c7c Cleanup: Define macros for GP modes
Define new macros for checking grease pencil object mode to cleanup code.
2017-10-09 23:47:01 +02:00
089835469a Fix error in default gp object after delete
If delete the gp object and it is assigned as default scene gp object, must be cleared.
2017-10-09 19:19:58 +02:00
049eb49f9a Enable MSAA for strokes
This AA is activated with Multisample parameter of user preferences screen.
2017-10-09 16:19:17 +02:00
2af1a0b628 Merge branch 'blender2.8' into greasepencil-object 2017-10-09 10:21:21 +02:00
465ca2659d Merge branch 'blender2.8' into greasepencil-object 2017-10-07 13:14:50 +02:00
a99f812902 Merge branch 'blender2.8' into greasepencil-object 2017-10-06 23:56:56 +02:00
c09fe51f9d GP Branch Version Patching - Use palette slots instead of creating palettes directly 2017-10-06 19:24:36 +13:00
d911287d91 Revert whitespace edits in interface_utils.c
These appear to be accidental, and are unrelated to the purpose of this branch.
2017-10-06 16:55:36 +13:00
d225202f05 Merge branch 'blender2.8' into greasepencil-object 2017-10-05 18:54:11 +02:00
32c0a98c27 Merge branch 'blender2.8' into greasepencil-object 2017-10-05 10:06:12 +13:00
31efc624dc Fix: Palettes were getting freed before GPencil datablocks on exit 2017-10-05 10:01:21 +13:00
cf87d5759b First test to implement FXAA 2017-10-04 15:12:03 +02:00
c3d6b5ebcf Merge branch 'blender2.8' into greasepencil-object 2017-10-05 01:52:27 +13:00
432bd31276 Fix compile error after merge
(Also added convenience API to make it easier to add new palettes to GP
datablock without having to worry about manually fixing usercount)
2017-10-05 01:16:24 +13:00
59310a9259 Fix: When adding 2D Monkey, the Palette got too many users assigned 2017-10-05 00:52:57 +13:00
b83d72242b Added missing support for duplicating Palette Slots when copying GP data
For now, it will only increment the usercount of the referenced palettes.
2017-10-05 00:52:57 +13:00
ebe0113ba3 Code Cleanup / TODO Notes (re- reuse of palettes when validating) 2017-10-05 00:52:56 +13:00
df62778a55 Tweak behaviour of adding a new GP Palette (to match other parts of Blender)
When creating a new Palette with an existing Palette assigned to a slot,
a copy of the old Palette will be created (i.e. the new copy will have all
the same colours), instead of creating a blank palette.

This makes it easier to create different versions of the same palette.
2017-10-05 00:52:55 +13:00
bacca732cc Code Cleanup / Compile Fix
Further cleanups for the 2D monkey primitive - this time, to move
all the data arrays out of the single massive function, and out to file level.

Hopefully this solves the compile problems with GCC.

If nothing else, the file now compiles much faster here on MSVC
(i.e. previously, it was taking ~10-20 seconds to compile)
2017-10-05 00:52:55 +13:00
490a3bb944 Palette Slots - Temporary verison-patching code to add slots for early 2.8 files saved without these 2017-10-05 00:52:54 +13:00
1369e9d298 Palette Slots - Add operators to Add/Remove Palette Slots
* Add will create a new (empty) slot by default

* Remove will shown an error if the slot is currently still used by
  any strokes. Perhaps in future, it should remap the strokes instead?

* Added icon for Palette Slots (it uses the same icon as Palettes now)
2017-10-05 00:52:53 +13:00
5dbb81a638 Fix: Missing undo flags for various GP operators 2017-10-05 00:52:53 +13:00
8c8c80701b Code Cleanup - Remove old/non-existent operator defines 2017-10-05 00:52:52 +13:00
cc1a0fc314 Fix: Newly created palettes for palette slots got an extra/unneeded user 2017-10-05 00:52:52 +13:00
49f394946e Various fixes to get GP Palettes UI working
* Switched the UI to using the "active_gpencil_palette" (and palette color) context
  vars (in favor of the "active_palette"/color) ones for retrieving the active
  palette. For some unknown reason, context.active_object returns null when
  trying to use it in the Properties Editor when drawing UI layouts, but it works
  perfectly fine when operators calling operator.poll() or running operators.

* Sanitise many of the hacks added to the Palette operators to make them usable
  for Grease Pencil-linked palettes (e.g. remove special hacky args)

* Add RNA support for getting the active GP palette slot
2017-10-05 00:52:51 +13:00
0f83cba7d2 BKE_palette_get_active_from_context(C) now retrieves GP palettes from the active palette slot
if the active object is a GP object

This makes it possible to reuse all the Palette operators as-is,
without having to add a lot of GP-specific duplicates, and also
simplifies much of the context polling stuff.
2017-10-05 00:52:50 +13:00
7c9467ae1f Palette Slots - Add UI panel for Palette slots 2017-10-05 00:52:50 +13:00
aed1892c24 Code Cleanup: Move panel definitions for Palette-based colors to the Material panels file
Annotations (GP in 2D editors) will not be using this stuff,
as they will not have most of the fancy drawing options (as
they are based on the traditional 2D api instead).
2017-10-05 00:52:49 +13:00
6d6e06d39b Palette Slots - Changing assigned palette via RNA calls relevant API func to set things correctly 2017-10-05 00:52:48 +13:00
3dced61b1d Fix: Don't create redundant palette for Monkey 2017-10-05 00:52:48 +13:00
ac68a69294 Fix: Add 2D monkey adds palette link 2017-10-05 00:52:47 +13:00
c3b9b7b8e4 Fix: Strokes weren't visible while drawing
Missed this usage of palettes in previous commit
2017-10-05 00:52:46 +13:00
8cbc7334f0 Palette Slots - Replace all places initialising GP palettes 2017-10-05 00:52:46 +13:00
924112241b GP: Modify existing operators to use new palette api's 2017-10-05 00:52:45 +13:00
d01d7d053e Code Cleanup - Group all palette initialisation stuff together in same function 2017-10-05 00:52:44 +13:00
8f34d5cdb3 Cleanup - Change naming of Palette Slot vars to be easier to type 2017-10-05 00:52:44 +13:00
5d69c71adf Palette Slots: Internal API's for managing Palettes 2017-10-05 00:52:43 +13:00
ec6f392bc9 Merge branch 'blender2.8' into greasepencil-object 2017-10-03 18:28:51 +02:00
0e99d51a38 Remove antialiasing code
These functions are not working here. Need a new approach using FXAA.
2017-10-03 18:27:03 +02:00
ba077b368c Add function to fix palette bug
Added a function to fix old files with palette set to NULL by program error.

This fix will be removed in the future, but now it's required to work in open movie files.
2017-10-03 17:58:34 +02:00
61d6c4f8b9 Merge branch 'blender2.8' into greasepencil-object 2017-10-02 20:12:46 +02:00
7c3588c603 Cleanup comment 2017-10-02 11:13:09 +02:00
90152f6bcb Add Antialiasing to Grease Pencil 2017-10-02 11:07:46 +02:00
53ca11ad13 Merge branch 'blender2.8' into greasepencil-object 2017-10-01 19:16:03 +02:00
ef4c69a715 Add curve options to Thick modifier
New options to adjust the thickness of the stroke using a curve to get more artistics effects.
2017-10-01 18:54:30 +02:00
dbf2a0c54f Fix merge error 2017-09-30 16:53:38 +02:00
606679fd75 Merge branch 'blender2.8' into greasepencil-object 2017-09-30 16:06:19 +02:00
2473eb2b67 Optimize Fast Drawing memory management 2017-09-28 16:16:04 +02:00
18576dff30 Various RNA fixes (noticed while adding palette slot support)
* Added missing define for GP Object datatype in rna_Object_data_typef
* Improved a few descriptions/comments
2017-09-29 02:47:17 +13:00
c751391082 Fixes for various problems with the linked-datablock handling code for GP features
* The new "Scene->gp_object" field was not being relinked in various places

* The "bGPDstroke->palette" relinking calls were missing the standard "id.lib" args

* "bGPDlayer->parent" should be handled in lib_link_gpencil() not direct_link_gpencil(),
  It was also not handled in the expand_doit()
2017-09-29 02:47:17 +13:00
d1c33f87cc Code Cleanup - Some leftover cruft/reshuffling/formatting 2017-09-29 02:47:16 +13:00
a0acc64d35 Palette Slots - File IO and Basic RNA support 2017-09-29 02:47:15 +13:00
b77cfd7bf8 Palettes Slots - Fix incomplete DNA changes from previous commit 2017-09-29 02:47:15 +13:00
1b7b2a9a9f Merge branch 'blender2.8' into greasepencil-object 2017-09-28 13:02:52 +02:00
3c2186cbbf GP Palette Slots - Initial DNA structures
Start of support for GP "Palette Slots". These act like "Material Slots"
in that they allow a single GP datablock to refer to multiple Palette
datablocks, making it easier for the user to manage the set of available
palettes.
2017-09-27 19:41:59 +13:00
5c8e1dfc28 Code Cleanup - Clarifying names, comments, and shuffling fields for clarity 2017-09-27 19:34:01 +13:00
5a52a54c0e Code Cleanup - Move all old/deprecated bGPDpalette stuff together to be easier to remove/disable in future 2017-09-27 17:05:17 +13:00
f4eeb87fa2 Code Cleanup 2017-09-27 17:04:23 +13:00
a38d43d461 Build fixes after merge
iroundf -> round_fl_to_int
2017-09-27 14:31:48 +13:00
c6e4456778 Merge branch 'blender2.8' into greasepencil-object
Conflicts:
	source/blender/editors/transform/transform_manipulator.c
2017-09-27 14:27:17 +13:00
adda09c418 Code Cleanup: Move 2D Monkey code to its own file in editors/gpencil 2017-09-27 14:01:22 +13:00
5dfe46b985 Fix: The code to reset GP Objects to Object Mode on load wasn't working 2017-09-27 14:01:21 +13:00
009faf1cb3 UI: Remove Palette Panel header 2017-09-26 12:42:30 +02:00
eca2d5f405 Merge branch 'blender2.8' into greasepencil-object 2017-09-26 10:57:13 +02:00
04fcd84794 Code Cleanup: Replaced inlined layer-copying code with a call to the copy_ex() method 2017-09-26 15:40:46 +13:00
2cb0e188e2 Fix: Make Single User wasn't supported for GP Objects 2017-09-26 15:13:22 +13:00
5b45258fff Fix: Doing a Scene "full-copy" wouldn't relink the gp_object 2017-09-26 15:12:50 +13:00
e7395c75d5 Fix: When transforming GP strokes in "Local" mode, the strokes would get obscured by
the transform constraint lines
2017-09-26 12:50:37 +13:00
f25541be38 Fix: If the active object is not a GP object, starting to draw
with D-LMB would create a new GP object

This was behaviour was bad if you were trying to use GPencil for
anything other than 2D-3D art (e.g. for creating freehand input
for addons/Pose Sketching, annotating your work in EditMode, etc.)
as you could easily end up with all your annotations/sketches in heaps
of separate GP objects.

This commit improves the sitation slightly, by introducing an
"GPencil Object" property to Scene (similar to the existing "Active Camera"
and "Active Clip" settings).
* The idea is that the first GP object added to the scene as the "default
  GPencil Object".
* Everytime you start sketching with GPencil AND the active object isn't
  a GPencil Object, this "default GPencil Object" will become the active object,
  and any strokes you draw will be added to this object (instead of a new
  GP object being created)

TODO:
* Investigate if we can do this without losing whatever mode the user was
  in previously. This new workflow makes GPencil a lot less useful for a
  bunch of different annotation/addon workflows it could be used for in 2.7
2017-09-26 01:15:25 +13:00
04f25532ed Code Cleanup 2017-09-26 01:15:24 +13:00
7d08bf4a66 Rename "Copy" color operator to "Rename" 2017-09-25 11:14:05 +02:00
38dd6a75c0 Merge branch 'blender2.8' into greasepencil-object 2017-09-25 10:29:35 +02:00
d7a7bb8753 Merge branch 'blender2.8' into greasepencil-object 2017-09-22 16:33:25 +02:00
1cf6eaa154 Merge branch 'blender2.8' into greasepencil-object 2017-09-21 22:56:08 +02:00
7fb657c854 Merge branch 'blender2.8' into greasepencil-object 2017-09-21 19:29:22 +02:00
49e9738d6e Change replace palette UI text
Some minor changes to make it clearer.
2017-09-21 18:01:07 +02:00
7ff31e0270 New Enable/Disable editing lines option
Allows to disable the new editing lines. Now the option is in Display panel, but maybe need to be moved to new panel or reorganize.
2017-09-20 12:04:49 +02:00
329d3fe59b Fix typo error in Onion Panel 2017-09-20 11:32:49 +02:00
404f547683 Fi T51923: Crashes on selecting bone in edit mode
Need to verify FBO state before initialize framebuffer
2017-09-20 10:27:48 +02:00
a155734fac GP Properties: Tidy up Onion Skinning and Display panels
Initial attempts to tidy these panels up, according to points identified
in last night's review.
2017-09-20 13:07:38 +12:00
b1f871d031 Code Cleanup: PEP-8 2017-09-20 12:45:17 +12:00
2e77290873 GP Mode Menu Tweaks
* Rename "Stroke Paint" mode to "Draw", and make it the last item
* Use standard EditMode icon
2017-09-20 10:54:52 +12:00
0099e867bf Arrange strokes in several layers
It's more convenient to arrange strokes in all layers, and not only in active one.
2017-09-19 16:38:24 +02:00
c9654e6e88 Set Onion frame range to 1 as default 2017-09-19 10:44:07 +02:00
8ca7a46086 Merge branch 'blender2.8' of git@git.blender.org:blender.git into greasepencil-object 2017-09-19 16:49:33 +12:00
036f60d300 Cleanup: Remove unused code 2017-09-18 12:22:58 +02:00
6a1d59c188 Cleanup: quiet warnings for GCC 2017-09-18 19:50:50 +10:00
4adb6cac66 Fix bad range checks 2017-09-18 19:10:14 +10:00
d8fdae6132 Merge branch 'blender2.8' into greasepencil-object 2017-09-17 17:14:27 +02:00
773f9f19d8 UI: Disable Onion filter at Layer level
If main switch is disabled, thios column must be disabled too.
2017-09-16 19:39:03 +02:00
2527c2c3e7 Solve some minor issues in onion panel 2017-09-16 16:01:28 +02:00
6ce8857dba Fix problem with onion override
There were some conflicts in the override with main options.
2017-09-16 10:19:58 +02:00
9d31574dd1 Merge branch 'blender2.8' into greasepencil-object 2017-09-15 17:26:32 +02:00
0c3a83a8be UI: Change label text 2017-09-15 17:24:43 +02:00
8955328719 Add override options for onion skinning
This commit add options to modify at layer level the default onion skinning parameters defined at object level.
2017-09-15 17:19:56 +02:00
9fee39af71 Move onion skin settings to GP datablock
Now that we have GP object, it's better to move onion skining settings at object level and keeep only a flag to enable disable at layer level.
2017-09-15 10:34:59 +02:00
d1ac3fd077 Fix error in onion skinning
The shgroup id was not updated in the loop.
2017-09-14 18:42:34 +02:00
54c7ac2c7a Fix opacity problem with fast drawing.
The pass was doing double blending.

Thanks to Clement Foucault for his help solving this issue.
2017-09-14 16:54:47 +02:00
2f8d9d1cc8 Fix Blur problem wit opacity.
There was a double blending that reduced opacity
2017-09-14 16:36:51 +02:00
9291c0e3d7 Fix functions renamed by merged commit 6d359e 2017-09-14 12:50:05 +02:00
684ca04786 Merge branch 'blender2.8' into greasepencil-object 2017-09-14 12:32:43 +02:00
5f9b2ae2f0 Add option to disable fast drawing
This option has been added to compare viewport speed while drawing, but maybe can be good to keep it.
2017-09-13 20:32:57 +02:00
afdbad9924 Fix missing line of previous commit 2017-09-13 09:28:15 +02:00
ffda00ee71 Rework in Fast Drawing to avoid lags
Try to avoid any lag for very short and fast strokes
2017-09-13 08:17:17 +02:00
f7d40ced53 Merge branch 'blender2.8' into greasepencil-object 2017-09-12 17:09:55 +02:00
ed9b98c63f New Viewport Fast Drawing
Now a temp texture is used while the user is drawing to get an instant feedback.
2017-09-12 14:54:50 +02:00
2801dbffe3 Merge branch 'blender2.8' into greasepencil-object 2017-09-11 16:43:15 +02:00
11dc55f3c6 Fix segment Fault in Onion Skin after play
Sometimes, after run animation or change the frame , the drawing cache was not set as invalid and produced a segment fault.
2017-09-11 16:16:55 +02:00
65081e17f7 Add new Fade and Opacity to Onion
New parameters to define the opacity and a parameter to enable/disable fade effect.
2017-09-11 12:43:49 +02:00
69aea4c596 Make paint cursor size fix
After some testing, display the real size of the brush is not practical because is too disruptive and the size of cursor does not change with zoom factor. The decision was to use a fix size, instead of  paintbrush->thickness value.
2017-09-11 10:34:28 +02:00
11d2b76aa4 UI: Change simplify options order 2017-09-10 19:38:53 +02:00
5bc000a901 Fix error in simplify
The simplify was pplied with master check disabled
2017-09-10 19:18:16 +02:00
0421076179 Simplify: new option to remove fill lines
For filling areas, sometimes is good to have a way to hide the external line of the stroke that makes the fill when select simplify.

Fixed the error of render flag because the storage field was too small, so a new field has been added for simplify only.
2017-09-10 16:55:48 +02:00
890b9249d4 New Information Panel
This panel shows information about number of layers, frames, strokes, points and palettes used.

Notes: The number of frames in the internal data, not the number of different keyframes number.

The panel is not updated automatically to avoid performace issues. Close and reopen panel to refresh. Maybe, this could be changed, but need to be checked before.
2017-09-10 12:16:04 +02:00
63ea7124e1 Merge branch 'blender2.8' into greasepencil-object 2017-09-10 10:04:28 +02:00
4a89c0cd58 New Simplify panel
These options allow to speed up the viewport similar to mesh simplify.

Note: The render options are disabled while the render workflow is defined.
2017-09-10 10:02:40 +02:00
d1768b616d Apply lattice modifer in each frame
The lattice must be evaluated in each frame, not in the location of the first frame only.
2017-09-09 16:17:06 +02:00
95636294f1 Merge branch 'blender2.8' into greasepencil-object 2017-09-07 12:19:42 +02:00
76474b09d0 Merge branch 'blender2.8' into greasepencil-object 2017-09-06 16:09:05 +02:00
ebd72c93a5 Enable MultiEdit keys in Sculpt/Weight Paint modes
The Q and Shift+Q keys can be used in Sculpt and Weight Paint modes too, and not only in Edit mode.
2017-09-04 11:45:53 +02:00
19764a20c4 Enable Multiedit in Weight Paint mode 2017-09-04 11:42:45 +02:00
1f5bf340c5 Cleanup: Replace int text to double quotes 2017-09-03 11:07:14 +02:00
47dcf365f7 Merge branch 'blender2.8' into greasepencil-object 2017-09-03 11:03:20 +02:00
99420e96a8 Merge branch 'blender2.8' into greasepencil-object 2017-09-01 09:59:17 +02:00
291d253326 Fix drawing error when object has been scaled
If the object was scaled, the thickness of the stroke must be scaled while drawing.
2017-08-31 17:33:14 +02:00
de4dfd664f Change default values for Pencil Brush 2017-08-31 17:05:41 +02:00
ac521ef853 Set Pencil brush as default
This is only valid if the brush list was not created before
2017-08-31 17:02:13 +02:00
0c9ef211c9 Change default PixSize to 500
Thios value is better to keep default Blender size: 1 bu = 1 mts
2017-08-31 16:57:31 +02:00
9a1ba7b122 UI: Move Eraser radius to Option tab as new panel 2017-08-31 16:43:00 +02:00
a6a84a5ab6 UI: Rename Panel Brush Options to Strokes 2017-08-31 16:33:39 +02:00
0d2fdedb57 Merge branch 'blender2.8' into greasepencil-object 2017-08-31 12:23:01 +02:00
cd3f0eea03 Fix screen update after select keyframes
This problem was related to Onion Skinning and Multi Edit when selected a keyframe in dopesheet.
2017-08-31 12:19:33 +02:00
92eb3572c5 Add Shift+Q to enable only multiedit lines 2017-08-31 11:11:05 +02:00
7e5fe13205 Enable Onion Skinning in Edit and Sculpt mode
Only disabled in weight paint mode
2017-08-30 17:03:48 +02:00
63e651d9db Merge branch 'blender2.8' into greasepencil-object 2017-08-30 16:42:35 +02:00
c248778601 Show only lines for MultiEdit strokes 2017-08-30 16:41:28 +02:00
abea4e7c9b New option to define color of edit line
A new field for MultiEdit was added too
2017-08-30 16:15:03 +02:00
db08a30cd9 New toggle MultiEdit operator with Key Q
This allows to switch very fast between edit modes
2017-08-30 11:26:30 +02:00
b0d6cbfeec Speed up multiedit loop
If not multiedit, avoid the loop in select
2017-08-30 10:52:29 +02:00
130d522064 MultiEdit in Sculpt Mode
Allow to use Multi Edit in Sculpt mode. Now the brushes can be applied to several frames.
2017-08-29 16:10:08 +02:00
81feb43461 UI: Move multiedit to 3Dview bar
Remove from panel and add to the bottom 3D View options bar
2017-08-29 15:41:59 +02:00
4033f05c30 Add transformation data for multiedit 2017-08-29 12:59:49 +02:00
d42feef6f8 Change define to select mulñtiple strokes
This define is used in selection of points
2017-08-29 12:32:37 +02:00
d3f5314716 Change editable_gpencil_stroke context for multiedit 2017-08-29 12:17:12 +02:00
27f90459b7 Merge branch 'greasepencil-object' into GP-MultiEdit 2017-08-29 11:48:04 +02:00
a9256f2e92 Merge branch 'blender2.8' into greasepencil-object 2017-08-29 11:47:38 +02:00
c1518938d8 Draw several frames when multiedit is enabled 2017-08-29 11:46:05 +02:00
3879c96e6b Add new flag for MultiEdit
Note: The new UI options now appears in display panel but it will be moved out in future changes.
2017-08-28 13:28:43 +02:00
63039cf442 UI: Fix onion options error when no layers 2017-08-28 12:28:34 +02:00
7e93fcca80 Merge branch 'blender2.8' into greasepencil-object 2017-08-28 12:06:10 +02:00
9ebf679a0b Merge branch 'blender2.8' into greasepencil-object 2017-08-27 18:57:05 +02:00
1774a7b290 Merge branch 'blender2.8' into greasepencil-object 2017-08-25 16:48:45 +02:00
26dbbef14c Fix Lock icons
This icons were removed by error in an old merge commit
2017-08-25 09:51:45 +02:00
c1bc167f98 Change maximum range for pixel size 2017-08-24 19:38:17 +02:00
07b191ef5a Remove previous commit
This is not required because the widget manage the transformation
2017-08-24 18:47:29 +02:00
63ba22713c Fix problem with axis in Local transformations 2017-08-24 18:33:20 +02:00
e20c0e3615 Merge branch 'blender2.8' into greasepencil-object 2017-08-24 16:24:50 +02:00
13e72721f9 Rotate manipulator for Grease Pencil
Before only global orientation was supported
2017-08-24 16:04:11 +02:00
05f7b06d70 Merge branch 'blender2.8' into greasepencil-object 2017-08-24 11:48:06 +02:00
ae1cce7831 WIP: Move points in local space
Still  a problem with manipulator and axis feedback lines that are not rotated to local space
2017-08-24 11:23:45 +02:00
38b6e10780 Disable onion skinning in edit modes 2017-08-23 16:46:27 +02:00
aca714c18f Fix merge error 2017-08-23 13:28:41 +02:00
3e972fb582 Merge branch 'blender2.8' into greasepencil-object 2017-08-23 12:58:46 +02:00
c0d0aba8b6 Reorganize Onion drawing and hide on Play
Hide on play the onion skinning and refactor drawing functions for onion skining
2017-08-23 12:55:06 +02:00
bd62abc592 Set cache as dirty when remove frame 2017-08-22 20:13:13 +02:00
0eb7227e3c Remove Previous/Next mode in Onion Skinning 2017-08-22 20:08:31 +02:00
7e4ce1e804 Make Vertex Group operator available in Sculpt mode
As vertex group tools are used to manage vertices is good to have these tools available in Sculpt mode too.
2017-08-22 19:11:25 +02:00
a0439804a6 UI: Create a new panel for Brush options 2017-08-22 18:58:25 +02:00
b8afabf0f1 Fix memory leak in VBOs
After the last change in GWN_BATCH_DISCARD_SAFE(), is necessary to create the Batch using GWN_BATCH_OWNS_VBO to free the memory.
2017-08-22 17:19:51 +02:00
46ea09ef3c Check if modifiers before calling function 2017-08-22 13:33:27 +02:00
6692bb03a6 Merge branch 'blender2.8' into greasepencil-object 2017-08-22 11:30:41 +02:00
1e1eac9836 Cleanup: Rename Onion modes 2017-08-21 11:33:11 +02:00
92cb02bb4e Merge branch 'blender2.8' into greasepencil-object 2017-08-21 11:12:20 +02:00
7a3cf91a01 New Onion modes
Add options to set the range of frames in absolute or relative mode. Reorganized UI panel too.
2017-08-21 11:09:10 +02:00
678b02436a Merge branch 'blender2.8' into greasepencil-object 2017-08-20 18:33:17 +02:00
bceec2c62a Merge branch 'blender2.8' into greasepencil-object 2017-08-20 15:32:02 +02:00
01360899c2 Merge branch 'blender2.8' into greasepencil-object 2017-08-20 11:53:06 +02:00
d31de4f490 New Onion skinning for select frames only
Add an option to display only the frames selected in dopesheet.
2017-08-19 22:55:54 +02:00
0d80a85816 Cleanup code and comments 2017-08-19 16:48:38 +02:00
26e796c04f Chnage angle limits to allow negative values 2017-08-19 13:39:37 +02:00
f69944d046 Change UI panel 2017-08-19 13:28:01 +02:00
aa9cf8e1f9 Merge branch 'blender2.8' into greasepencil-object 2017-08-19 12:23:42 +02:00
d2a34bc4ce Use object location as center for swirl 2017-08-19 12:22:57 +02:00
faee6037bb Merge branch 'blender2.8' into greasepencil-object 2017-08-19 10:51:57 +02:00
9d55e5f5ed First try to apply Lattice GP modifier in all frames
Still not working but define the initial steps to do it.
2017-08-18 16:21:51 +02:00
6cb1d3c8f1 New VFX Swirl modifier 2017-08-18 13:10:16 +02:00
e9230845ec Merge branch 'blender2.8' into greasepencil-object 2017-08-18 10:37:02 +02:00
41f06ff9b2 Fix error checking edit mode button in VFX 2017-08-17 19:35:55 +02:00
08842f1171 Merge branch 'blender2.8' into greasepencil-object 2017-08-17 18:58:10 +02:00
48f985d080 New VFX pixelate modifier 2017-08-17 17:37:18 +02:00
9bb932a842 Support MSVSC 2017 15.3.0 (compiler 19.11)
The compiler version has changed in the last VS2017 update to 1911 and the old 1910 version is not working anymore.
2017-08-16 15:58:09 +02:00
89667fa0d3 Rename function 2017-08-16 14:11:56 +02:00
c6a66b1966 Merge branch 'blender2.8' into greasepencil-object 2017-08-16 13:21:33 +02:00
80631317a7 Change const type
Add const modifier to eval_ctx defiition to follow merged code rules.
2017-08-16 13:03:06 +02:00
93a0cc9c46 Merge branch 'blender2.8' into greasepencil-object 2017-08-16 10:33:55 +02:00
470851aeba Fix error in Onion skinning
THe onion was not working because when create derived_gpf, the next and prev frames were set to NULL by error.
2017-08-16 10:28:32 +02:00
87c7d4d2a3 New options to copy colors attenuated 2017-08-15 19:06:08 +02:00
c23526ac73 Fix segment fault when draw polygons 2017-08-15 12:16:07 +02:00
23d224101a Cleanup typo error 2017-08-14 16:52:10 +02:00
e6d82c9873 Cleanup comments 2017-08-14 16:33:21 +02:00
96b41a2c7f Change Blur algorithm 2017-08-14 16:19:18 +02:00
ffbe876fdd New buffer use in Blur modifier
The previous version created a loop with the framebuffer. Now a ping pong framebuffer is used.
2017-08-14 15:49:41 +02:00
ccb6a043bf Fix error in change Palette
Must change all frames not only active
2017-08-13 17:56:15 +02:00
490971b3e6 Change default values 2017-08-13 13:02:40 +02:00
1f7e171575 Merge branch 'blender2.8' into greasepencil-object 2017-08-12 10:48:29 +02:00
cc220781aa Reorganize VFX modifiers code 2017-08-11 17:30:58 +02:00
4545b30dd8 Second step to include Pixel Factor
This add the final changes to use pixfactor in shaders
2017-08-11 17:16:36 +02:00
0feed8bb23 First step to include Pixel Factor
This is equal to old commit but step by step to avoid z-depth error. Doing the commit more granulate allow to debug better the code.
2017-08-11 17:08:32 +02:00
54eb034c08 Revert "Add new factor to define pixel scale due z-depth error"
Produce unexpected errors in z-depth and need more review before apply.

This reverts commit 62677a73e1.
2017-08-11 16:35:18 +02:00
b793e07d0c Change strengthin Tint modifier 2017-08-11 15:39:57 +02:00
5225f43235 Change Opacify modifier again
The fill color only must be changed if was defined with an opacity factor.
2017-08-11 13:25:50 +02:00
625f799514 Remove Opacity factor soft limit
Now the range is free from 0 to 2
2017-08-11 10:24:13 +02:00
1eadb4e8e1 Fix Opacity modifier do not change fill opacity
The fill opacity cannot be set to 1
2017-08-11 10:14:06 +02:00
3749310734 Fix error setting origin to 3D cursor 2017-08-10 20:23:45 +02:00
af1587ecd0 Cleanup space line 2017-08-10 17:53:01 +02:00
e078a42e4e Merge branch 'blender2.8' into greasepencil-object 2017-08-10 17:42:27 +02:00
1a00c6ae36 Fix errors after merge 2017-08-10 17:40:38 +02:00
b5a116dad4 Merge branch 'blender2.8' into greasepencil-object 2017-08-10 17:37:26 +02:00
a6f5adb836 Fix Lattice memory leak
The loop need to free memory to avoid memory leak
2017-08-10 17:11:58 +02:00
be36035058 Tint modifier change alpha if value > 1
The alpha only change if the value of the factor is greater than 1. Whith a value of 2, get a full tint with full opacity.
2017-08-10 16:39:18 +02:00
62677a73e1 Add new factor to define pixel scale
This new parameter allows to define the factor to convert stroke thickness to pixel scale.

By default the factor was set to 40 that gets a good result.
2017-08-10 16:27:28 +02:00
beb2ec2bb4 Cleanup: Remove compiler warning 2017-08-10 12:28:05 +02:00
448241cf96 Fix Tint error when factor is 1
When factor is 1, must override the alpha of the original color
2017-08-10 11:42:24 +02:00
23b37b7c2f Fix opacity modifier error with values greater than 1.0
If the opacity is set to >1 values, the alpha must be overrided.
2017-08-10 11:19:25 +02:00
288c2c4999 New Dissolve modes
Now is possible dissolve between selected points or unselected points.

This is used to simplify a stroke.
2017-08-10 10:40:50 +02:00
9d99c9f379 Include Eraser radius on UI and add keymap
The eraser radius must be available on Paint mode
2017-08-09 17:03:20 +02:00
77291e0305 Fix error with tablet eraser pen
Detect if the eraser pen is enabled without pressing any key.
2017-08-09 16:52:51 +02:00
1829f693bb Add samples option to VFX Blur modifier 2017-08-09 16:09:16 +02:00
eafc840faf Cleanup compiler warning 2017-08-09 10:26:29 +02:00
44479daa2f UI: Reorganize Stroke style panel 2017-08-08 20:29:04 +02:00
cd3ff68df3 Fix opacity modifier problem with 2.0 value
When the value is set to 2.0, the stroke opacity must be set to 1.0 to force a complete solid drawing.
2017-08-08 16:40:38 +02:00
34afceb924 New Simplify stroke operator
Internally runs the same function used in Simplify modifier, but as operator.
2017-08-07 16:58:13 +02:00
dfadb0a9b6 Cleanup: Fix typo error 2017-08-07 16:51:20 +02:00
d9890fdb7a Cleanup: Remove unused variable 2017-08-07 16:46:50 +02:00
fe393bd2a9 Keep color selected when move
When move up or down in the color list, the color must keep selected.

The code has been cleanup too.
2017-08-07 16:21:16 +02:00
cbb019718c UI: Move options to side menu button 2017-08-07 16:03:28 +02:00
1cc673ebcc UI: Move buttons in panel 2017-08-07 16:00:42 +02:00
9acbf720a0 UI: Add space between fill type and color 2017-08-07 15:52:51 +02:00
a42c59d27c UI: Set some panels closed by default 2017-08-07 15:50:11 +02:00
9f7f310e25 Fix z-depth problems in wave modifier 2017-08-07 13:14:51 +02:00
91407293bf Fix segment fault with Dupli modifier
This error was introduced after adding support for modifiers in edit mode
2017-08-07 12:13:02 +02:00
b85916efdd Merge branch 'blender2.8' into greasepencil-object 2017-08-07 11:28:42 +02:00
be12ccff4a VFX Wave modifier uses PI range
The sinusoidal curve uses a loop between 0 and PI to get better and smooth result
2017-08-07 11:04:41 +02:00
a9a37ac46c Fix problem of VFX double drawing
The vfx pass needs a separate framebuffer to avoid double drawing of the strokes.

If necessary, a full copy of the initial texture is done to be used by all vfx modifiers.
2017-08-07 10:52:00 +02:00
6abd28097d New VFX Wave modifier
Distorsion using sinusoidal wave
2017-08-06 17:07:53 +02:00
e1a798c375 Cleanup: Reorganize code 2017-08-06 15:55:52 +02:00
0c6ddc2a7b New VFX Gaussian Blur modifier
This modifier works only at viewport level and cannot be applied.
2017-08-06 13:20:50 +02:00
72b709c4a4 Cleanup: Reorganize code 2017-08-05 18:20:14 +02:00
b57d6e920e WIP: Basic structure of VFX Gaussian Blur
This is the first step to implement a system for adding VFX modifiers that are applied to viewport and not to strokes
2017-08-05 17:52:45 +02:00
4e0cd81d25 Hide Apply and Copy button for GP
The VFX modifiers cannot be copied or applied
2017-08-05 17:51:40 +02:00
24ceb20f54 WIP: Basic shader for gaussian blur 2017-08-05 17:04:57 +02:00
bf869459bb Merge branch 'blender2.8' into greasepencil-object 2017-08-05 11:19:06 +02:00
890f9d315c Minor changes to simplify modifier 2017-08-05 11:05:24 +02:00
4ab7104a97 Cleanup: Rename function 2017-08-05 10:39:38 +02:00
0e1933512c Cleanup: Remove unnecessary struct 2017-08-04 21:02:56 +02:00
61d6eb84c3 Fix mistake in previous commit 2017-08-04 21:00:20 +02:00
8f46b719da WIP: New simplify modifier
The modifier uses Ramer Douglas Peucker algorith to simplify lines.

New more work to get more control.
2017-08-04 17:49:53 +02:00
5b54c66334 Make default object display size smaller 2017-08-04 10:36:14 +02:00
a583c5ed91 Make edit lines more transparent 2017-08-04 10:35:05 +02:00
5abe6b0f3c Fix select error with Suzanne 2D
The strokes must be created with 3D space flag enabled.
2017-08-04 10:26:44 +02:00
cf19500907 UI: Cleanup error when context object is none 2017-08-03 23:21:28 +02:00
37acc75871 Cleanup: Fix some minor issues in Suzanne 2D 2017-08-03 23:09:33 +02:00
8f0e5be8aa Add a primitive for 2D Suzanne 2017-08-03 20:42:19 +02:00
f7726a09f0 Add a line when edit strokes
This thin line helps to determine the stroke shape
2017-08-03 14:10:43 +02:00
d83774c003 WIP: Basic support to display modif in edit mode
Still more work needed, but this commit add basic support to display the modifiers in edit , sculpt and paint mode.
2017-08-03 13:02:32 +02:00
173ba2e6f3 Merge branch 'blender2.8' into greasepencil-object 2017-08-03 11:13:04 +02:00
19f6e3b72a Rename file to avoid compiler error 2017-08-02 10:31:09 +02:00
3e63990dd3 UI: Hide options in weight paint mode 2017-08-01 17:39:50 +02:00
d62acd434c Cleanup: Change some definitions 2017-08-01 14:02:56 +02:00
aab881520d Merge branch 'blender2.8' into greasepencil-object 2017-08-01 13:21:04 +02:00
c618a6cf92 WIP: New weight painting mode
New mode to define the weights by stroke point.
2017-08-01 12:49:16 +02:00
6551b09f41 WIP: Weight paint mode
Initial work to implement new weight paint mode.

Now only the new weight paint brush in sculpt mode is available, but not the mode itself.

New brush paint icon design by Matias Mendiola.
2017-07-31 20:55:45 +02:00
9a413c47a4 Merge branch 'blender2.8' into greasepencil-object 2017-07-31 13:05:44 +02:00
f4abac2d78 Add bContext to Lattice modifier data for future uses 2017-07-31 12:14:23 +02:00
bdafec8488 Cleanup: Review modifier stack for lattice 2017-07-31 11:56:20 +02:00
1aeeb0bd69 Remove and move weight when remove vertex group
When remove a vertex group, moves the index of other weights
2017-07-31 11:34:51 +02:00
c3f0a0477b Cleanup: Reorganize and rename
New gpencil_modider.c module for modifiers and rename functions to keep naming convention
2017-07-31 10:42:42 +02:00
bf83610263 WIP: More work for vertexgroups
Apply vertexgroups to modifiers
2017-07-31 10:15:50 +02:00
8bab103f42 WIP: Fisrt step to implement Vertex Groups
Still more work is required to use the vertex groups, but this commit add the data to bGPDspoint struct and basic functionalities.
2017-07-30 19:08:41 +02:00
abb4147391 Move update of lattice outside
The update of the GPD cache  is moved to the corresponding update functions
2017-07-29 10:31:41 +02:00
5e03de11b7 Merge branch 'blender2.8' into greasepencil-object 2017-07-28 15:47:33 +02:00
c5a2c5699f Cleanup: Remove duplicate header definition 2017-07-28 15:40:37 +02:00
2bad140c09 Fix missing object after reload
When reload a file the lattice object assigned to the modifier was missing.

The object neede a relink inside the modifier
2017-07-28 15:35:54 +02:00
6d1a991d9a WIP: Basic Lattice modifier
Still problems loading a previous file and other issues
2017-07-27 21:07:32 +02:00
fd4a629b4d Move LatticeDeformData struct definition to header
This struct is used outside of the lattice module now and the definition now can be shared in other modules.
2017-07-27 12:13:46 +02:00
02543bf7a1 Fix segment fault when free GHash
If the GHash is null, don't free again
2017-07-26 16:51:56 +02:00
c34bcd5edf Fix rotate 3D view segment fault
The context was wrong for new modes
2017-07-26 16:28:15 +02:00
15919f4039 WIP: more work in cache 2017-07-26 16:11:42 +02:00
6016d3b539 Cleanup: Remove redundant parameter 2017-07-26 14:03:50 +02:00
3f26e92d0f Remove CACHE_REUSE
If we use a different area by object, the cache never can be reused
2017-07-26 13:55:13 +02:00
d78bf6ef99 Fix memory leak 2017-07-26 13:48:36 +02:00
53cb7be722 WIP: Basic new batch_cache by object
Need more work and review memory leaks
2017-07-26 13:29:56 +02:00
76ffc76b40 WIP: Add hash for derived frame
This is the first step to allow multi-user datablock
2017-07-26 12:02:29 +02:00
92e343258a Merge branch 'blender2.8' into greasepencil-object 2017-07-26 10:09:01 +02:00
553373be96 Fix error when rotate using 3D cursor
The rotation of the strokes must use cursor in local space.
2017-07-25 20:52:16 +02:00
030990fe45 Merge branch 'blender2.8' into greasepencil-object 2017-07-25 15:47:26 +02:00
e0bd578742 Fix error when make single user 2017-07-25 12:51:20 +02:00
da56864439 Fix memory leak 2017-07-25 12:01:15 +02:00
6622673b3f Fix error with user number
When apply array modifier the gpd is not reused, so the us must remain equal.
2017-07-25 11:14:18 +02:00
02800b747d Fix error when apply Array with more modifiers
When apply an array modiifer is necessary to create new GP datablocks and remove in the duplicate object the array modifier to avoid double effect.
2017-07-25 10:21:26 +02:00
7f444d8b34 Fix error if apply modifier with multi-user GP
The modifier cannot be applied if the GP datablock is used for more than 1 objects.
2017-07-25 10:04:49 +02:00
739960a0e1 Set all default HSV range to 1 2017-07-24 20:24:49 +02:00
1566beb4b2 Fix error when apply color related modifiers
The effect was duplicated for each stroke and the result was wrong
2017-07-24 16:46:03 +02:00
63971f4c63 New Hue/Saturation modifier 2017-07-24 13:49:19 +02:00
6bc0375d22 Opacity modifer affect strength
If the factor is > 1, the strength of the stroke is affected by modifier
2017-07-24 12:42:10 +02:00
b7d4ad7d7f Clamp to valid range 2017-07-24 12:15:17 +02:00
ff39754a95 Remove object control for Opacity
There was several problems to use an object to control opacity and how change fill opacity, so it's better to remove this and find an alternative (maybe using  shaders)
2017-07-24 11:27:36 +02:00
b9e90d53f5 Cleanup: Remove double initialization
The minmax function does this initialization.
2017-07-24 10:47:45 +02:00
f620f73b5f Filter index pass only if > 0 in modifiers
If the pass index is equal to 0, the filter is disabled. This is a handy way of reset the filter without adding new flags.
2017-07-24 10:46:24 +02:00
040d763042 WIP: Basic implementation of Opacity modifier
Still pending the target functionality.
2017-07-24 10:44:38 +02:00
3f64a0df1d Add Set Origin to Geometry
New option to set origin at the center of the strokes of the current frame.
2017-07-23 20:09:54 +02:00
54c4712888 Cleanup: Remove unused variables 2017-07-23 20:08:50 +02:00
509d1328ef Fix error duplicating object with modiifers 2017-07-23 17:50:26 +02:00
0dec2be679 More work on create objects when apply array modifier 2017-07-23 17:22:33 +02:00
f7597d1be7 Cleanup: Use standard function 2017-07-23 16:43:00 +02:00
137fdb1a66 Move define to share 2017-07-23 16:25:11 +02:00
be9d97bbe3 Cleanup code 2017-07-23 16:20:39 +02:00
03c2b29a12 Array modifier is not visible in edit mode 2017-07-23 12:40:24 +02:00
a6fd5d7c4c Fix context parameter to eval_context
The context is eval_context not bContext
2017-07-23 12:34:35 +02:00
4bba60dedc Fix error to apply modifier in wrong modes
The modifier only can be applied in object mode
2017-07-23 12:33:45 +02:00
5e1259f7da Cleanup compiler warning 2017-07-23 12:12:54 +02:00
7d25a2eb34 Merge branch 'blender2.8' into greasepencil-object 2017-07-23 11:48:09 +02:00
27b1129d57 Rename of modifiers completed
Now the old Dupli modifier is named Array and Array named Dupli
2017-07-23 11:19:30 +02:00
20e94d7f92 Before to swap array and dupli names
It's more logic to name Array the modifier called Dupli, so I'm going to swap the names
2017-07-23 10:14:20 +02:00
b2a829ea78 Cleanup: Fix typo error 2017-07-22 12:05:20 +02:00
b2d5a0b722 WIP: New Duplication modifier
This modifer works similar to use dupliobjects for the current GP object.

Still pending apply button.
2017-07-22 11:48:39 +02:00
63066150b3 Tint modifier: Create colors in new palette 2017-07-21 20:57:33 +02:00
4e50a1eb3a Cleanup: Change calculation using only matrix 2017-07-21 20:40:39 +02:00
3626088926 Cleanup: Remove some uses of G.main 2017-07-21 17:24:47 +02:00
fb299a9eed Merge branch 'blender2.8' into greasepencil-object 2017-07-21 16:40:50 +02:00
f2fe6d28f6 Fix parameter list after 2.8 merge 2017-07-21 16:34:31 +02:00
67c2eab6a1 Merge branch 'blender2.8' into greasepencil-object 2017-07-21 16:10:48 +02:00
6c05a3a99a Set cache as dirty after apply modifier 2017-07-21 15:52:33 +02:00
2b1056183c WIP: More work on modifiers
Reorganize the system to create new strokes in array modifier
2017-07-21 09:29:04 +02:00
188b1c9b29 Basic support for rotation/scale in array modifier 2017-07-20 17:26:27 +02:00
87ff38cd9e More work on modifiers
Complete rework, now the modifier data is saved in a cache and is not recalculated for each redrawing. The previous version had the problem the array strokes suffered of effect acumulation.

The array modifier is pending to add the rotation and scale parameters. Now only appear in UI panel but don't work.
2017-07-20 17:21:11 +02:00
188412246c New field to save derived data from modifiers 2017-07-20 12:03:15 +02:00
1b40b4ba30 Prepare data for new options in array modifier 2017-07-20 11:16:19 +02:00
20b1ca6cdf Fix problem when tint array strokes
The new strokes had different color because the tint was done two times
2017-07-19 16:57:40 +02:00
23c42898a1 Add inverse filter options for modifiers 2017-07-19 14:03:57 +02:00
fdd24be794 Merge branch 'blender2.8' into greasepencil-object 2017-07-19 13:18:08 +02:00
9cc10c5154 Enbale Random by default in Noise modifier 2017-07-19 13:15:21 +02:00
cb312e3a3e WIP: Initial implementation of array modifier 2017-07-19 12:23:34 +02:00
334b5e8707 Fix missing definition 2017-07-18 17:18:42 +02:00
148898479b Fix T52111: Buffer stroke obscured by buffer fill 2017-07-18 17:08:08 +02:00
92d7c9b71e More work on Noise modifier 2017-07-18 16:56:05 +02:00
6f55b2c2a5 Verify scene pointer before moving frame 2017-07-18 14:25:26 +02:00
1db1e9f816 Noise modifier move full stroke
Now it's possible to move points or full stroke
2017-07-18 14:16:53 +02:00
abfa37f715 Add step parameter to Noise modifier
Now it is possible to define a number of frames between recalculate random noise. This allows to reduce the speed of change because before, sometimes  was too fast.
2017-07-18 12:06:54 +02:00
e2a26260b5 Support several palettes in Tint modifier
When create a new set of color, support to have several colors with the same name in different palettes
2017-07-18 10:50:50 +02:00
05058ab443 Fix T52100: Buffer stroke is not visible if paint over fill
If paint  a stroke over a fill area, the drawing stroke was not visible while drawing and only when finish the stroke.

The drawing pass was mixing the with mix pass and now reuse the stroke mix. This solve the problem and increase the drawing speed because only one mix pass is necessary
2017-07-18 10:20:26 +02:00
8abb684546 Change Name of new modifiers
If use the prefix GP_, the name is not visible if the panel is narrow
2017-07-18 09:45:08 +02:00
0b2c081943 New Tint modifier
This modifier allows to tint with a color all strokes and create a new set of colors when apply the modifier
2017-07-17 20:40:42 +02:00
792ed2babc Cleanup: Fix comment 2017-07-17 16:04:10 +02:00
6ece5080cd Merge branch 'blender2.8' into greasepencil-object 2017-07-17 13:45:02 +02:00
9b293649ed Fix line removed by error
The cache must be checked
2017-07-17 13:38:51 +02:00
0c034ade43 Fix problem when check spacetype 2017-07-17 13:20:44 +02:00
2245dc80da Fix error with fill and modifiers
The modifiers must be evaluated before to affect stroke and fill
2017-07-17 13:08:15 +02:00
2f22054670 Apply smooth to subdivision modifier 2017-07-17 12:26:56 +02:00
c569634b72 WIP: More work on modifiers
Add new modifier for thickness and reorganize code
2017-07-17 12:05:44 +02:00
cd27283fde Fix modifier update when change mode 2017-07-16 18:54:06 +02:00
b424845bb5 New subdivide stroke modifier
This modifier add intermediary points to stroke to get more control points for other modifiers as Noise.

This is not a subsurf modifier. This will be a different one.
2017-07-16 17:40:29 +02:00
3c6f2af764 Refresh cache when modifiers are changed
The draw cache must be set as dirty after move up/down or remove modifier
2017-07-16 17:27:09 +02:00
4ce5b85fe1 Cleanup: Replace by standard function 2017-07-16 15:48:29 +02:00
171f6b9ab0 Cleanup: Remove unused define 2017-07-16 15:32:54 +02:00
da957a2678 More changes to noise modifier
Apply more changes and add support functions for apply, remove, etc.
2017-07-16 13:24:55 +02:00
3474115e73 WIP: First modifier for grease pencil 2017-07-15 19:46:06 +02:00
677aa38b0f Proof of concept to duplicate stroke 2017-07-15 11:29:13 +02:00
348c240924 Merge branch 'blender2.8' into greasepencil-object 2017-07-14 20:41:54 +02:00
be708092ac Merge branch 'blender2.8' into greasepencil-object 2017-07-13 18:06:38 +02:00
f1088f32f5 Merge branch 'blender2.8' into greasepencil-object 2017-07-13 18:03:31 +02:00
5e31d6ca40 Merge branch 'blender2.8' into greasepencil-object 2017-07-13 17:25:51 +02:00
01acf2e3cf Merge branch 'blender2.8' into greasepencil-object 2017-07-13 16:46:39 +02:00
b9c2800249 Merge branch 'blender2.8' into greasepencil-object 2017-07-13 11:34:52 +02:00
5b2b5d177e Remember last Palette used
When select a GP Object, the last palette used for drawing is selected. The palette only is selected if one stroke was drawn with this palette.
2017-07-13 11:33:12 +02:00
f0a7567154 Cleanup: Replace by generic function
Call generic default creation code
2017-07-13 10:59:37 +02:00
ef71351961 UI: Rename panel caption 2017-07-12 20:35:14 +02:00
a1f00219ce UI: Move frame lock and opacity to layer panel 2017-07-12 20:33:57 +02:00
125e2092ca Create default brushes and colors
Create a set of colors and drawing brushes when add a new GP object.
2017-07-12 20:31:03 +02:00
119ee390e7 UI: New Options panel by layer 2017-07-12 16:53:52 +02:00
b611d03952 UI: New parent layer panel
Move these options to new panel and reorganize layer options
2017-07-12 16:19:42 +02:00
34822e1c72 UI: New panel for onion skinning 2017-07-12 16:05:10 +02:00
227ae3021f Fix error if use several GP objects
The flag was set wrong
2017-07-12 14:17:57 +02:00
541e81ac96 Fix color distorsion while drawing
Need to use the mix_pass in order to get the same color while drawing. If the pass is not mixed with the same pass than strokes, there is a change in the color between drawing stroke and final stroke due the process to mix.

This is slower, but needed and while drawing the time delay is negligible
2017-07-12 14:12:14 +02:00
32a244caa1 Merge branch 'blender2.8' into greasepencil-object 2017-07-12 13:04:42 +02:00
6b0814af9f UI: Reorganize Palette Colors panels (WIP)
Create new panels for stroke and fill parameters
2017-07-12 13:02:56 +02:00
535ae9e1b1 Rename volumetric stroke type 2017-07-12 11:42:03 +02:00
9b1b46951c UI: Change ruler panel header
Now the panel is empty in some modes because we will add primitives in the future, but we want to keep the panel as reference.
2017-07-11 17:16:01 +02:00
738fd20839 UI: Move show direction to data panel 2017-07-11 17:03:18 +02:00
f3384e79da Fix error when undo
The drawing cache must set to dirty to avoid segment fault
2017-07-11 16:46:59 +02:00
f82f9738c5 UI: Keep tab order consistency
The tabs must be on the same order when change mode
2017-07-11 15:56:02 +02:00
4a3b7b12b5 Merge branch 'blender2.8' into greasepencil-object 2017-07-11 13:47:37 +02:00
13c60e2a52 Change Cursor management
Change how the cursor is displayed on screen and mimic standard look and feel for grease pencil
2017-07-11 13:45:33 +02:00
573074eb22 UI: move convert to geometry and ruler
Move the convert to geometry to new panel and hide rler if enable gp modes
2017-07-09 20:26:09 +02:00
ba026ff848 UI: Hide Relations and Physics panel
Hide these panel if enter in special GP modes
2017-07-09 17:36:41 +02:00
fc2e1c3a5e Fix error drawing polyline
Drawing polyline to old files produced segment fault because the cache was not marked as dirty.
2017-07-09 16:23:36 +02:00
628946ac66 Use cache_dirty instead of cache_free 2017-07-09 15:51:27 +02:00
7f29c49f89 Fix error setting origin
The calculation was not right if the object had rotations
2017-07-09 13:33:11 +02:00
adb8104c7d Finish polyline session releasing Shift
For artist is better cancel polyline drawing session releasing the shift key instead to press Esc or Enter.

Now, to draw polylines keep shift pressed and finish releasing this key.
2017-07-09 11:41:37 +02:00
24ea750659 WIP: Boundbox for GP object
This is the first implementation but cannot test because Eevee not support bounding box yet.
2017-07-08 21:22:12 +02:00
5636c5e486 UI: Enable set origin for GPENCIL type 2017-07-08 19:24:41 +02:00
a122bb8f1c Merge branch 'blender2.8' into greasepencil-object 2017-07-08 18:58:27 +02:00
612dc1008d Cleanup: remove unused line 2017-07-08 18:17:52 +02:00
2d85ed0547 Add warning if mode is not supported
Warning user if try to use a non supported set origin option
2017-07-08 18:00:05 +02:00
a21c36a272 Remove custom set origin operator
This change has been integrated in standard set origin operator
2017-07-08 17:38:56 +02:00
79f55f9544 Include set origin in standard origin operator
Instead to use a dedicated operator use standard
2017-07-08 17:33:37 +02:00
679d46ff02 Add menu to set origin operator
In order to keep the UI consistency I have added a menu.

This menu has only one option, but the UI panel looks more consistent
2017-07-08 17:10:06 +02:00
dc2e2704ad New Set Origin operator
This operator allows to change the pivot point origin for strokes.

Only valid in Edit Mode

Keymap: Ctrl+Alt+Shift+C
2017-07-08 16:24:07 +02:00
41b1687bb9 Merge branch 'blender2.8' into greasepencil-object 2017-07-07 17:00:40 +02:00
2c3ba5ef64 Cleanup: Rename icon identifier 2017-07-07 16:59:41 +02:00
80df0932bc Use new object origin icon 2017-07-07 16:52:31 +02:00
e427056b2c New Object Origin Icon
This icon is used to define stroke placement

Designed by Matias Mendiola
2017-07-07 16:52:06 +02:00
4486e89de7 Add stroke placement 3D Cursor
Add the option for 3D cursor in list of placement options and not as separated option to make UI more consistent.
2017-07-07 13:35:15 +02:00
31732af410 UI: reorganize animation panel
Create a grease pencil animation panel and separate again interpolate panel.

The default animation panel is hidden when GP Object is selected and enable some GP mode
2017-07-07 12:37:24 +02:00
f6079d5019 Merge branch 'blender2.8' into greasepencil-object 2017-07-06 12:04:00 +02:00
01738f7ad9 Change range limit for line_width 2017-07-06 12:01:01 +02:00
90a6621b25 Fix error loading old files
After a previous commit to relink palettes old files did not work
2017-07-05 20:44:00 +02:00
2381e70541 UI: Hide draw buttons
Remove these buttons from panel to keep  UI consistency
2017-07-05 16:20:00 +02:00
e5f5913625 Add new keymaps for straight and poly strokes
Line: Ctrl+LMB
Poly: Shift+LMB
2017-07-05 16:16:05 +02:00
95a7dfe4ca Merge branch 'blender2.8' into greasepencil-object 2017-07-04 17:42:59 +02:00
24c35bbf41 UI: Change interpolate panel header
Rename the header and add some options to make UI cleaner
2017-07-04 17:27:51 +02:00
c494f6cc8d Set GP modes from outliner
Set special gp modes if the object is selected in outliner
2017-07-04 17:19:37 +02:00
233d03934a UI: Make interpolate panel open by default 2017-07-04 16:55:34 +02:00
e4465f7f96 Increase paint brush size range 2017-07-04 16:48:40 +02:00
68bca5c640 Keymap F to change paint brush size 2017-07-04 16:43:11 +02:00
e4692002a0 Remove Stroke placement option 2017-07-04 16:01:21 +02:00
0b5d287b83 Reorganize stroke materials panel
The stroke style now has only solid or volumetric type and the texture and pattern have been moved as options shared by both styles.
2017-07-04 12:41:44 +02:00
c922172ca9 Cleanup: Remove unused variables 2017-07-03 20:27:55 +02:00
fb5f9763fa WIP: Add volumetric while drawing 2017-07-03 20:14:12 +02:00
d3c486fcc3 Cleanup: Remove unused line 2017-07-03 19:37:04 +02:00
35dccf35f1 WIP: Add geometry shader for volumetrics 2017-07-03 19:36:06 +02:00
9d2fce6479 UI: Hide stroke color if stroke style is texture 2017-07-03 09:10:46 +02:00
f9d625a1a1 UI: Move additive drawing to animation tab 2017-07-02 18:49:50 +02:00
dda3c11b4d UI: Move Insert/Delete frames to animation tab 2017-07-02 18:46:58 +02:00
4de700a8a6 UI: Move Draw on back to brush panel 2017-07-02 18:39:41 +02:00
3d7e5f2578 UI: Hide continuous drawing option in 3D view 2017-07-02 18:37:00 +02:00
a2e079918f UI: Move interpolate panel to animation 2017-07-02 18:35:05 +02:00
cbad88435c WIP: Basic stroke volumetric support
This need more work to expand volumetric features. Commit these changes to put in place all the pieces of the system.

We keep as is today while we decide the final design.
2017-07-02 18:10:08 +02:00
065013a957 Fix error when play animation
If the same datablock was used, there was a crash. The frame change must be evaluated before other checks.
2017-07-02 16:49:27 +02:00
2317f8c14a New stroke styles: Texture and Pattern 2017-07-01 17:06:46 +02:00
927694fd13 Changes in previous fix for T51942
The previous commit broken the stroke color update
2017-06-30 20:49:07 +02:00
8d4072f434 Merge branch 'blender2.8' into greasepencil-object 2017-06-30 20:14:29 +02:00
d0c17ef893 Fix T51942: Color not updated in UI panel
When update the color in the panel, the color box was not updated after release control.
2017-06-30 20:02:44 +02:00
d958084187 Merge branch 'blender2.8' into greasepencil-object 2017-06-30 15:39:06 +02:00
073ef79840 Fix T51936: Show draw strokes since first stroke
The drawing stroke must not be related to cache drawing because only one stroke is done at time.
2017-06-30 15:34:34 +02:00
1af42b70d1 Minimize Alpha stroke issue
Here we need is OIT (Order Independant Transparency) which is still an open issue in the realtime field (and also for Eevee). The best OIT method I know of is somewhat complex and not very precise (still not 1:1 with the ordered version). It involves more framebuffers and performance cost.

I may need to implement that in the draw manager in the future so that all engines can use it.

Thanks to Clement Foucault for the support provided.
2017-06-30 14:41:59 +02:00
4e17d1086a Merge branch 'blender2.8' into greasepencil-object 2017-06-29 16:44:33 +02:00
b8df9f6531 Merge branch 'blender2.8' into greasepencil-object 2017-06-28 13:15:04 +02:00
401086a012 Show edit points only for active object
The GP edit points are only visible for the active object, as defined in 2.8 for mesh editing, to keep UI consistency.

Before 2.8 version the edit points were visible for all objects sharing same datablock.
2017-06-28 13:12:38 +02:00
1ea4ca5faf Fix error when edit datablock used in several objects
When edit the datablock got segment fault.

Now a new hash is used to determine if the object was duplicated. This hash speed up drawing process too.
2017-06-28 10:40:05 +02:00
230d089a30 Cleanup: Improve debug messages 2017-06-27 17:43:21 +02:00
f0ada8377b Cleanup: Remove unused uniform 2017-06-27 16:52:51 +02:00
95c2c1c06f Initialize index fields for shgroups 2017-06-27 13:02:30 +02:00
9343e9cde3 Merge branch 'blender2.8' into greasepencil-object 2017-06-27 12:43:31 +02:00
b3693fa30e Fix error in GP modes for undo
When undo the special gp modes did not work.
2017-06-27 12:39:36 +02:00
76498ed570 Avoid load files with gp modes enabled
The new files must be loaded in Object mode and not in special grease pencil modes.
2017-06-27 12:05:17 +02:00
6fe488e849 WIP: Draw only the shading groups of the object 2017-06-26 21:23:40 +02:00
fe2b895a65 Merge branch 'blender2.8' into greasepencil-object 2017-06-26 20:43:52 +02:00
bdd32dce69 WIP: Use new DRW_draw_pass_subset
This commit is not complete yet
2017-06-26 20:23:56 +02:00
dd2372f187 Merge branch 'blender2.8' into greasepencil-object 2017-06-26 12:23:51 +02:00
c810e0b059 Merge branch 'blender2.8' into greasepencil-object 2017-06-24 12:27:05 +02:00
a0d88989b9 Cleanup: Add double cursor check inside function 2017-06-24 12:10:10 +02:00
a841490a2b Move again some passes inside loop
This will be necessary when the clear shgroups is on the loop
2017-06-24 12:02:44 +02:00
71fa7dbda9 Cleanup: Rename field 2017-06-24 11:28:07 +02:00
5e4be98317 Set texture to RGBA_16
It looks the RGBA_32 is not necessary
2017-06-23 20:31:43 +02:00
d8991b23e3 Enable point selection in sculpt mode
To use selection mask during sculpt need to use point selection operators.
2017-06-23 16:39:15 +02:00
bf30180654 Display edit point in sculpt mode
To use the sculpt mask option is necessary to see the selected points

Maybe need to include the select/unselect operators in sculpt too
2017-06-23 16:26:25 +02:00
54a3466f1c Merge branch 'blender2.8' into greasepencil-object 2017-06-23 15:56:07 +02:00
f4a4e394ff Change temp texture to DRW_TEX_RGBA_32 2017-06-23 09:30:22 +02:00
f7c57c5cd6 Fix problem with sculpt cursor
The cursor was not set when switch between object in different modes.
2017-06-23 09:22:03 +02:00
8d12ac0f31 Add DRW_STATE_DEPTH_ALWAYS to stroke pass
This option is required to use the zwrite option
2017-06-22 19:33:55 +02:00
fe6d4fd911 Merge branch 'blender2.8' into greasepencil-object 2017-06-22 19:11:15 +02:00
13ac2a49b0 WIP: First step to fix z-depth problem
Need a change in draw manager to allow writting zdepth without checking adding DRW_STATE_DEPTH_ALWAYS

Thanks to Clement Foucault for all the help fixing this bug.
2017-06-22 19:08:34 +02:00
4d0f0360a6 Cleanup: Rewrite if/else to make more compact 2017-06-22 17:13:28 +02:00
8e1bc5a4d2 Cleanup: Move edit and current pass out of loop
These passes don't need to be repited.
2017-06-22 13:16:39 +02:00
e8e714cc01 Cleanup: Remove unused function 2017-06-22 13:12:35 +02:00
90d7dcfe2f Fix drawing segment fault when hide colors
The batch cache must be set to dirty for all GP Objects and not only current one.
2017-06-22 12:55:38 +02:00
2103296faa Cleanup compiler warnings 2017-06-22 12:25:33 +02:00
71b4834adf Merge branch 'blender2.8' into greasepencil-object 2017-06-22 11:19:00 +02:00
cd813bae2b Rename functions and structs to new Gawain naming
As this branch is not the current blender2.8, these renaming was missing in grease pencil new code.
2017-06-21 21:00:07 +02:00
c0811b73b9 Fix merge error 2017-06-21 20:56:45 +02:00
7e66f8b140 Merge branch 'blender2.8' into greasepencil-object 2017-06-21 17:17:43 +02:00
2b0ad19dc3 WIP: Add a temp framebuffer to control z-depth
The stroke is rendered to temporary framebuffer and then render again using fullscreenquad to add the z-depth.

This cannot be done in one step because the strokes must keep the internal layers order without using z-depth values.

Still some problems with z-depth texture.
2017-06-21 16:53:09 +02:00
1e47f3368b Undo z-depth manipulation method
This method is not enough precise to get clean drawings, so we need to find an alternative solution.
2017-06-19 17:07:42 +02:00
8c310227d2 Cleaun: Add clamp to keep zdepth in valid range 2017-06-19 10:12:17 +02:00
bc348f274a Cleanup and move constant to defines 2017-06-19 10:09:44 +02:00
7eb1d77a3d Fix keep thicknees by object
This option must be by object, not by scene.

Cleanup some code too and rename to use better naming for variables.
2017-06-19 09:55:35 +02:00
453e6b7e74 Add mid range for zfight 2017-06-18 21:01:00 +02:00
693dfda035 WIP: adjust the shift factor with distance 2017-06-18 19:46:08 +02:00
501f22db81 Cleanup: Remove unused code 2017-06-18 18:49:56 +02:00
5fc2055c15 WIP: zfighting al most fixed.
Need a way to fix the problem of zdepth  and precision
2017-06-18 17:24:01 +02:00
c6ceb23aa9 Merge branch 'blender2.8' into greasepencil-object 2017-06-17 21:01:56 +02:00
556fe186e8 Merge branch 'blender2.8' into greasepencil-object 2017-06-17 16:42:28 +02:00
1623bdd948 Merge branch 'blender2.8' into greasepencil-object 2017-06-16 09:50:03 +02:00
c623fccfc2 Remove upper limit of stroke thickness 2017-06-16 08:32:13 +02:00
767f4f4587 Fix error in Cameraview when zoom
The problem was related to object scale
2017-06-15 20:12:14 +02:00
6fc5f241ca Fix segment fault if palette is missing
In some weird situations the palette can be removed.

We could consider to remove all strokes in this situation, but need further analysis. We keep the pointer checking as initial solution.
2017-06-15 16:57:37 +02:00
ebb8628e1a Implement a hash to relink palettes
Add a hash system when relink the colors to strokes to avoid the loop of all colors for each stroke.

Could use a hash for palettes, but as usually the number of palettes is very low, the speed up using hash doesn't worth the code complexity.
2017-06-15 16:55:57 +02:00
845c32540f New icon for Outliner and changes in Stroke Paint icon
The outliner icon for grease pencil must be gray to keep UI consistency.

Changed the stroke paint icon to make more visible.

Icon design credits go to Matias Mendiola
2017-06-15 13:10:15 +02:00
9e79b41397 Fix error with object scale and stroke thickness
With new calculation of previous commit for stroke thickness the scale of the object was not used and need to be used.

Now the scale is included and an average value is used because the axis change is not directly related to the stroke thickness.
2017-06-15 10:24:15 +02:00
7df3b33d93 Fix problem of stroke thickness when zoom
The stroke thickness was not working fine in Camera view.

The credits for this fix go to Clemnt Foucault and Luca Rood, thanks for the help!
2017-06-14 20:52:19 +02:00
9fceef3895 UI: Change icons for lock axis 2017-06-14 17:05:12 +02:00
1f42989cb9 New Stroke Paint icon
Designed by Matias Mendiola
2017-06-14 17:03:13 +02:00
5a4630c6f3 UI: Change GP Object icon
Replace the icon for a better and clean. Thanks to Matias Mendiola
2017-06-13 23:17:43 +02:00
9f88059d55 Fix compiler error
THe workspace definition was missing
2017-06-13 18:11:09 +02:00
01b929345b Move OB_GPENCIL icon to new position
The new icon used a postion used by new icons in master, so need to be moved.
2017-06-13 18:02:29 +02:00
c0bb7ba144 Merge branch 'blender2.8' into greasepencil-object 2017-06-13 17:00:26 +02:00
a2d053085b Cleaunp: Remove more unused variables 2017-06-13 16:51:56 +02:00
99c595499f Cleanup: More unused variables
Remove gpd from gp_copybuf_validate_colormap
2017-06-13 16:46:50 +02:00
c3fa0adcbe Cleanup: Remove unused variable
Remove mode for cache_dirty
2017-06-13 16:41:08 +02:00
a432511724 Mark old palettes as deprecated 2017-06-13 16:20:41 +02:00
44aad48ea0 Fix warnings for copy paste
The merge code from master used the old BGPDpalette and the code must use the new Palette
2017-06-13 16:09:36 +02:00
Dalai Felinto
8d3e2af877 Grease Pencil: Fix problems linking object with Pallete
This should at the very least use a hash system. But it could even do a
local pointer lookup. (Way) More often than not multiple strokes will
point to the same pallete color.
2017-06-13 15:58:51 +02:00
fb688a838f Cleanup: Remove duplicate definition
Added in other commit already
2017-06-13 13:36:31 +02:00
030c1d4aea Cleanup compiler warnings 2017-06-13 13:27:49 +02:00
Dalai Felinto
e534fc8a87 Silence tons of warnings 2017-06-13 12:57:56 +02:00
9d3e2d640e UI: back randomize button
This button was removed in a previous commit by error
2017-06-12 20:29:02 +02:00
546a59053e Include lock axis option to all GP sculpt brushes
Al brushes that move points use the lock
2017-06-12 20:05:32 +02:00
2d6dee880d New sculpt lock axis implementation
This solution works better and it is faster
2017-06-12 19:49:50 +02:00
20573fbdc0 Cleanup: Define camera view type for pixel size
New define to make more clear and separate the perspective and camera view modes for pixel size calculation
2017-06-12 16:56:11 +02:00
e9634349f6 Set sculpt cursor when enter in sculpt mode 2017-06-12 13:48:17 +02:00
b4ece07eef Hide VIEW option for stroke placement
This option is not logic in the new environment. Keep line for future uses
2017-06-12 12:27:11 +02:00
d1d369672b Set Xray mode to 3D space by default 2017-06-12 12:20:04 +02:00
0a76dbba5b UI: Move show points to display panel
This option is not used all the time and moving we keep layer panel cleaner
2017-06-12 12:13:22 +02:00
76a6b1a17a UI: Add missing pressure button
This button was removed in a previous commit.
2017-06-12 12:05:12 +02:00
ce09bb4330 UI: Rename Drawing Brush Thickness to Radius 2017-06-12 12:02:56 +02:00
033f1871b6 Fix error with select sculpt brush with keys
When press 3, the brush 4 was selected. Fixed the error and reorganized brushes.
2017-06-12 12:00:06 +02:00
3d186481ec Merge branch 'blender2.8' into greasepencil-object 2017-06-12 11:13:00 +02:00
bec911a9bf Fix problem with Ctrl + Tab for GP objects 2017-06-12 11:11:48 +02:00
14c252b73b Fix problem with Tab key
The Tab key must enable Edit mode and back to previous mode
2017-06-11 20:16:01 +02:00
dd27e30c01 Fix error render only when GP object is not selected
When the GP object was not selected the stroke must be drawn
2017-06-11 19:01:21 +02:00
7bd3db6f9f Change UI modes text
It is more clear to use standard nomemclature for the modes
2017-06-11 17:37:45 +02:00
6178014eaf Implement Ctrl+Tab key to swith modes
The Tab key switch between GP mode and object mode or edit if it was in object mode.

Ctrl+Tab switch between last mode
2017-06-11 17:32:28 +02:00
020d99fe92 Implement restore mode for Tab key
Now when you press Tab key the mode back to previous GP mode and not to Object mode always.
2017-06-11 17:01:11 +02:00
a653420aa9 Remove brush sensivity from UI panel 2017-06-11 16:00:52 +02:00
7bbcf05428 Change UI layers panel header text 2017-06-11 15:56:17 +02:00
33da82855a Hide panel header for datablock 2017-06-11 15:51:11 +02:00
c2c802f505 Replace UI list by icon preview for brushes 2017-06-11 15:43:29 +02:00
8a64370364 Merge branch 'blender2.8' into greasepencil-object 2017-06-11 13:36:04 +02:00
34020882c3 New enum property for drawing brushes
This property is necessary to include a icon view in the UI panel
2017-06-11 13:33:03 +02:00
a4f98bef1c New Display UI panel
Options moved to new panel to organize UI
2017-06-11 10:44:10 +02:00
ac33c2fc46 Move Grease Pencil selector to top panel
In order to keep UI consistency, the datablock must be in the top panel, not in layers
2017-06-10 20:39:07 +02:00
19deb16965 New operator and keymaps to select sculpt brushes
Now it's possible to select the sculpt brush sing a key between 1 and 9.
2017-06-10 20:02:11 +02:00
f0865ef298 Fix error in add GP object operator
The invoke callback is not necessary.
2017-06-10 19:14:41 +02:00
35bf5da436 Change UI panel registration order
This change is to keep the Tools tab on top because if the grease pencil panel are register at the end, the Tools tab change to end.
2017-06-10 16:01:47 +02:00
0e1613d303 New icons for Grease Pencil sculpt brushes
In order to keep consistency, we have added icons to GP sculpt brushes similar to object sculpt
2017-06-10 13:32:50 +02:00
b647f8653d Implement lock axis in Sculpt grab brush
This is the first implementation to lock the axis while sculpt. In some extreme angles the result is not perfect, so maybe need a review.

We keep in this way while we found a better approach, maybe using the reprojection of the point as it is done when draw new strokes could work better.
2017-06-09 13:13:38 +02:00
1f4b9356f9 Add missing UI options for sculpt and paint mode
The onion and mask buttons can be used in sculpt mode also.
2017-06-09 10:53:13 +02:00
861f0370c8 Fix only_render for GP object
For GP objects, the strokes must be drawn in all cases. When only render is enabled, only the pivot point is hidden, but not the strokes.
2017-06-08 16:38:22 +02:00
56e2f990e9 Merge branch 'blender2.8' into greasepencil-object 2017-06-08 15:47:39 +02:00
eef92d418e Remove ALT key for straight lines
There was a conflict with new Eraser keymap. Keep only CTRL.
2017-06-08 15:44:27 +02:00
2c9401b73d Eraser only available in Paint mode
During sculpt and edit this operator is not available
2017-06-08 13:42:17 +02:00
adf05b0181 Implement object change while in GP modes
Now the user can select other objects for paint or sculpt.

In edit mode is not possible in order to keep UI coherence
2017-06-08 13:39:02 +02:00
7b6c7f07d5 Fix cursor error when using eraser
The cursor did not return to paint after using eraser
2017-06-08 12:15:20 +02:00
2758319abe Hide material panel in BI render for GP Objects
When a GP object is selected, this panel must be hidden
2017-06-08 12:04:49 +02:00
9e028f5feb Hide material panel in Cycles for GP Objects
When a GP object is selected, this panel must be hidden
2017-06-08 12:04:22 +02:00
65d470291c Fix error when no object selected 2017-06-08 11:57:00 +02:00
d29ea70283 Hide material panel in Eevee for GP objects
When a GP object is selected this panel must be hidden
2017-06-08 11:49:01 +02:00
05b9a677c6 Replace Erase Keymap to LeftMouse + Alt
In order to keep consistency with Blender, the right mouse is used to select objects, so the eraser must use a different key.

This can be changed after more workflow tests
2017-06-08 11:48:29 +02:00
b0d322c603 Change how continuous drawing works in 3D view
In 3D view is not ggod for wrokflow to enable continuous mode with the new paint GP mode.
2017-06-08 11:37:27 +02:00
987b4a51ff Edit strokes panel must be expanded by default 2017-06-08 11:17:02 +02:00
399c654042 Hide transform panel in GP modes
This panel only add noise to the panel while drawing
2017-06-08 11:15:48 +02:00
d94954c19b Change assigned icons for lock axis 2017-06-08 10:59:30 +02:00
ae23f56658 WIP: More UI changes and continuous drawing
More changes in the panels and enable continuous drawing mode by
default.
2017-06-07 16:40:15 +02:00
9ed07cf461 Set sculpt cursor when enter in sculpt mode
Include some cursor reset for other modes
2017-06-07 16:35:39 +02:00
40dc9b0f04 Set the default cursor
Sometimes when restore previous cursor, the value is not the default, so it's better to set manually.
2017-06-07 16:07:05 +02:00
f7a6d72c83 WIP: More UI panel reorganization 2017-06-07 14:02:01 +02:00
63639b9ed1 Reset cursor if mode change 2017-06-07 13:53:48 +02:00
3b675b1aa3 Enbale paint window cursor when enable paint mode 2017-06-07 13:27:51 +02:00
c1bededd1c WIP: UI panels reorganization
Moved the stroke placement to bottom of the viewport instead of Tools panel.
2017-06-07 13:11:07 +02:00
99b17b64ee Merge branch 'blender2.8' into greasepencil-object 2017-06-07 12:05:33 +02:00
014325fdd2 Move PaletteColors to Materials tab
Although the grease pencil colors aren't real materials, in order to keep UI consistency, we have moved to this tab the palette control.
2017-06-07 12:01:13 +02:00
18a8aac3c9 Fix bug for filling while drawing
If the opacity was set to 0, the filling area must not be showed during drawing
2017-06-07 10:28:20 +02:00
e709239530 Change toggle Paint and Sculpt mode keymaps 2017-06-06 20:42:16 +02:00
8d13fe340b Color Palette must be visible always 2017-06-06 20:38:29 +02:00
7480b2381d New fill style using patterns
Now it is possible to use a texture to define the fill color pattern, similar to the use of noncolor textures.
2017-06-06 17:19:48 +02:00
13b283504f Create new option to keep stroke thickness
In some situations is good to be able to keep the stroke thickness when viewport zoom factor change.

This option is disabled by default.
2017-06-06 13:18:13 +02:00
69c9163baf Cleanup: Fix merge error 2017-06-06 11:57:05 +02:00
afe41ab869 Merge branch 'blender2.8' into greasepencil-object 2017-06-06 11:34:41 +02:00
79660741ae WIP: Adapt UI panels to new GP modes 2017-06-06 11:22:44 +02:00
4c216cb982 Fix problem when back from paint and sculpt modes 2017-06-06 11:22:44 +02:00
4447eff930 Change keymaps for new modes 2017-06-06 11:22:43 +02:00
941a854674 Check mode status before change 2017-06-06 11:22:43 +02:00
1a47860969 Cleanup compiler warnings 2017-06-06 11:22:43 +02:00
a57f4ca240 Define keys to switch grease pencil modes 2017-06-06 11:22:43 +02:00
dd6b008fb4 WIP: Initial implementation for paint mode
The paint mode need more work, but it start to work.
2017-06-06 11:22:43 +02:00
5db3d17c8c WM: add WM_manipulatorgrouptype_append_ptr
Needed for PyAPI registration.
2017-06-06 11:22:43 +02:00
7a02efb716 WM: de-duplicate operator append code
WM_operatortype_append(_ptr) functions had diverged.
2017-06-06 11:22:43 +02:00
9365b6ed8e PyAPI: is_staticmethod used for classmethods's too
Add note to investigate this, don't change so close to release.
2017-06-06 11:22:43 +02:00
7942057abb PyAPI: correct exception, expect 'staticmethod' 2017-06-06 11:22:42 +02:00
c5b85c9879 DwM: skip background-set objects w/ selection 2017-06-06 11:22:42 +02:00
b010a804f2 Fix alembic tests not running with debug build on windows 2017-06-06 11:22:42 +02:00
359058f4b2 Clay Engine: Improve sampling of SSAO
Replace completly random noise by Blue noisen, giving a better aspect.
Also randomize the distance in the sample direction to cover the whole distance even with 1 sample. Using another blue noise for this.
Replace spiral samples (that had tendency to align if the number of samples was near the chosen constant) with Hammersley samples that have good coverage even for low number of samples.
Use a UBO instead of Texture (a bit less latency) making things a tiny bit faster.
Move the noise data to the SceneLayerData, because each render layer can have a different sample count.
2017-06-06 11:22:42 +02:00
e4591d3576 Eevee: Modify Blue Noise. 2017-06-06 11:22:42 +02:00
a02365ae5a Eevee: Move Spherical Harmonics to a new Probe UBO.
Keep data packing tight to prevent use of padding floats
2017-06-06 11:22:42 +02:00
9e2b85e171 Cleanup: Remove unused code to set mode
This code is not used anymore in viewport with new modes
2017-06-06 11:22:42 +02:00
b56339e528 WIP: Basic structure for new object modes
Now there are 3 modes: Edit, Paint and Sculpt strokes.

These modes are only for new GP object.

Notice: Now the paint and sculpt modes can be activated but don't work.
2017-06-06 11:22:41 +02:00
9022025fca Eevee: Material code refactor.
Separate material handling inside another file.
Make use of enums to identify shader variations.
Group all 64*64 LUTs into one array texture.
Only update world probe if world changes.
2017-06-06 11:22:41 +02:00
1550fa3db6 World: Add temporary update flag. 2017-06-06 11:22:41 +02:00
da99c6aca9 Remove Edit Strokes mode for scene
This mode is not necessary because the mode is added at object level and the scene level is not available anymore.
2017-06-06 11:22:41 +02:00
e073a0aa07 Fix T51587: Blender fails to interpret a specific layer in OpenEXR multilayer file 2017-06-06 11:22:41 +02:00
nBurn
fd3d9bf9f7 PyAPI: Cleanup "Python API Overview" doc
Reword to clean up some odd grammar (mostly dangling modifiers) and
improve readability.

Differential Revision: https://developer.blender.org/D2699
2017-06-06 11:22:41 +02:00
0d749dbc77 Fix T51691: Shear cursor input scales w/ zoom
Use relative value from cursor movement.
2017-06-06 11:22:40 +02:00
060b5672ca Merge branch 'blender2.8' into greasepencil-object 2017-06-03 20:05:58 +02:00
6c0d8edbb3 Disable datablock at scene level
Now to paint in 3D view is necessary to add a GPencil object
2017-06-03 20:00:25 +02:00
743eb1df51 Set Object mode as default for new strokes 2017-06-02 18:53:22 +02:00
d8839ac928 Convert always scene GP datablock to new GPencil object 2017-06-02 17:26:08 +02:00
04974c145d Cleanup: rewrite some lines for tab key 2017-06-02 16:07:20 +02:00
ed9fb4201a Fix tab key for Edit Strokes after Workspaces merge
The tab key for enter in edit mode for GPencil objects was not working with new workspaces.

Still there is a problem with datablocks at Scene level (TBD)
2017-06-02 13:26:36 +02:00
8066729f6d Fix missing edit strokes mode after merge Workspaces
After the merge, the mode was not working because the SPACE_INFO was not included.

Some minor changes too.
2017-06-02 12:29:34 +02:00
4cf8676705 Fix merge error due VS2017 crash
During merge, VS2017 crash and abort merge for this file.
2017-06-02 10:12:09 +02:00
b628990ae8 Merge branch 'blender2.8' into greasepencil-object 2017-06-02 10:08:27 +02:00
747bd3c369 Rename identifier OB_MODE_GPENCIL
Rename to prepare for new modes
2017-06-01 20:42:25 +02:00
2ee74e94aa Fix error for ghost icon in palette
THe ghost icon was not working with new draw manager because the check was not migrated.
2017-06-01 15:46:40 +02:00
81786c91e4 Cleanup comment 2017-06-01 11:12:19 +02:00
c0c0483244 Merge branch 'blender2.8' into greasepencil-object 2017-06-01 10:42:41 +02:00
7edf993ba6 Try to use dynamic memory for shading groups
The reallocation of the memory produce weird things, so we keep allocation maximum number while we found better solution.
2017-06-01 10:35:24 +02:00
e4ef59a6a3 Fix error when drawing in an empty frame
If drawing new stroke in an empty frame, but the layer had previous frames, the cache must be set as dirty to avoid segment fault.
2017-06-01 10:20:29 +02:00
ed338ba9d0 Cleanup: Remove unused field 2017-05-31 19:18:39 +02:00
844e8fbcd0 Cleanup: Remove unused code 2017-05-31 19:16:58 +02:00
ab53b68745 Merge branch 'blender2.8' into greasepencil-object 2017-05-26 20:02:21 +02:00
02c0bd9a4c Merge branch 'blender2.8' into greasepencil-object 2017-05-24 20:14:47 +02:00
c828780ec8 Merge branch 'blender2.8' into greasepencil-object 2017-05-24 19:34:18 +02:00
2d448dfee8 Fix error when duplicate GP object
When duplicate an object, the cache must be recalculated and is not copied.
2017-05-23 20:22:49 +02:00
789b53d8bd Create a separated struct to hold shading groups 2017-05-23 17:44:41 +02:00
62ec40e4e5 Merge branch 'blender2.8' into greasepencil-object 2017-05-23 15:58:32 +02:00
b7c8f44e79 Reproject the point while drawing
If the point is not reprojected and the axis is locked, the thickness of the drawing stroke is different when the stroke is completed.

Reprojecting the stroke drawing buffer simulate the stroke thickness when it will be reprojected in 3D space and get better drawing feedback.
2017-05-22 21:03:56 +02:00
5b33f88e9a New function to reproject a point
This function will be used while drawing in draw manager gpencil engine
2017-05-22 20:30:06 +02:00
b28e35dd02 Cleanup: Rename function 2017-05-22 20:24:44 +02:00
2ab792dcfd Cleanup: extract reproject functions 2017-05-22 20:18:30 +02:00
ed24e39b54 Merge branch 'blender2.8' into greasepencil-object 2017-05-22 14:59:29 +02:00
e545a50e2a Fix segment fault when using eraser
The cache must be marked as dirty after any change operation, and the eraser change the strokes
2017-05-21 19:40:08 +02:00
cad9f2fd17 Fix UI panel problem in properties tab 2017-05-21 17:44:29 +02:00
32a8f3551f Cleanup: More unused include files, reorganization and name changes 2017-05-21 17:29:58 +02:00
7af2a45a38 Cleanup: Remove unused include files 2017-05-21 17:19:55 +02:00
ecd4984278 Merge branch 'blender2.8' into greasepencil-object 2017-05-21 16:32:28 +02:00
82e3302f44 Create a cache to drawing objects
Due speciall requirements for 2D drawing, the GP objects must be drawn after be sorteed by zdepth value.

We cannot use a simple GPU zdepth because this override the current layer/strokes order and the artists need to keep these controls as primary sorting method instead of GPU zdepth.
2017-05-21 16:28:56 +02:00
62a8d9fb12 Create a shading group by stroke
As the drawing order is very important in 2D, each stroke must use its own shading group and don't share with others or the drawing order is missing and the layer system does not work.
2017-05-21 13:20:28 +02:00
cccd0cfc12 Disable zdepth write for strokes
After some analysis, the strokes must work without affect the zdepth buffer or the layer system will not work.

The 2D artist agree that layer system must be the main zdepth order and not the GPU checking.
2017-05-21 13:10:50 +02:00
8c0f4aa557 Cleanup: Create several separated functions 2017-05-20 20:27:40 +02:00
5bd0a6d25b Enable again write depth pass for strokes only 2017-05-20 19:40:35 +02:00
f384e83475 Remove write zdepth to avoid z-fighting
The strokes don't need to write the depth buffer
2017-05-20 16:50:32 +02:00
8ea8bf4dc6 Merge branch 'blender2.8' into greasepencil-object 2017-05-20 13:04:25 +02:00
b439a9a83f Cleanup: Change some xray strings and parameter names 2017-05-20 12:58:17 +02:00
73d3f283e1 Cleanup: Remove unused code
THis code has been ported to new shaders
2017-05-20 09:43:34 +02:00
4192c8214f Implement Xray mode for strokes
Now support 3 modes: Front, 3D space and Back.

Still some problems with zfighting with layers that need to be fixed
2017-05-19 20:28:57 +02:00
382b5f9d59 Use zdepth of the position in geometry shader 2017-05-19 16:48:37 +02:00
db8e8bafe5 Merge branch 'blender2.8' into greasepencil-object 2017-05-19 16:03:01 +02:00
d2d9244230 Add more control for debug lines
Now the debug lines are only visible when code is 668
2017-05-19 15:47:19 +02:00
c96cfbb196 Merge branch 'blender2.8' into greasepencil-object 2017-05-18 20:06:37 +02:00
875bbabc1e Separate zdepth to function to use in future
Now, the value is fixed but need to be calculated.
2017-05-18 10:11:52 +02:00
4bc2308959 Cleanup unused code 2017-05-17 16:51:38 +02:00
cd9ec95130 Add debug information 2017-05-17 16:50:25 +02:00
47c1fbdc85 Add set cache to dirty when Gpencil is update in several places 2017-05-17 16:42:42 +02:00
8651d02051 Remove old opengl code 2017-05-17 13:56:28 +02:00
8451c159e9 Remove zdepth check for Drawing buffer
The drawing buffer and edit point must be always visible
2017-05-17 11:47:35 +02:00
ab9f5c23ef Enable zdepth for passes.
Actually only works for filling
2017-05-17 11:34:14 +02:00
d7fc6198ea Merge branch 'blender2.8' into greasepencil-object 2017-05-17 10:44:33 +02:00
b47e10c4c7 Remove old opengl code in shaders 2017-05-17 10:25:12 +02:00
d05e145c46 Remove check on back of camera
This check is getting weird result and create a segfault in the cache due changes in the index of the stroke depending of point of view.

Need to have a better implementation. We keep disabled while we found a better solution that not change the index of the strokes (maybe separate this check and add to cache_idx anyway)
2017-05-16 20:33:05 +02:00
d607688f96 Fix segfault error when drawing several strokes in same drawing session
The clean of the cache must be done by stroke and not at the final of the drawing session.
2017-05-16 19:25:07 +02:00
9d01058d43 Migrate scale pixel code to vertex shader 2017-05-16 18:37:41 +02:00
da11a819eb Cleanup: Rename functions 2017-05-16 13:29:43 +02:00
c6e8202816 Fix problem with UI panel for convert to GP object button 2017-05-16 13:17:13 +02:00
f1c2f8ab83 Cleanup: Add EOL at end of file 2017-05-16 12:55:39 +02:00
30fe33fba6 Merge branch 'blender2.8' into greasepencil-object 2017-05-16 12:27:20 +02:00
9fea542986 Remove separated batch cache for points
The stroke batch cache can be used for points and strokes, because both are equal and we don't need to define separated variables and use more memory.
2017-05-16 12:25:13 +02:00
239e8f3ae4 Remove flag fields to control buffer stroke creation
These fields are not necessary now.
2017-05-16 12:22:02 +02:00
48b2e05ffd Update draw manager cache when change any RNA property 2017-05-15 20:12:18 +02:00
029f8292c0 Fix merge errors 2017-05-15 11:21:15 +02:00
d91d88c810 Merge branch 'blender2.8' into greasepencil-object 2017-05-15 10:56:00 +02:00
d8a37d3e7c WIP: Add a cache system for strokes
The new cache is allocated to save the strokes and is only recalculated when there are changes.

Need more testing to be sure all situations are working fine.
2017-05-15 10:42:04 +02:00
Dalai Felinto
4195e4cc7e Fix for edit modes (sculpt, weight paint) menus not showing in header
But introduced on 2b0f02057f
2017-05-15 10:42:04 +02:00
Dalai Felinto
e58b4d228b Startup.blend: set EEVEE as the default engine
The original idea was to use Clay as the default. But since clay may not
even be in the final release, we can't afford to have a startup.blend
that doesn't deliver a reliable result regardless of build options.
2017-05-15 10:42:04 +02:00
c873fc094f Use static assert in Clay engine to ensure struct alignment 2017-05-15 10:42:04 +02:00
a38a9751bf Some minor cleanup. 2017-05-15 10:42:04 +02:00
c7c5bf8a35 Fix again DwM bbones drawing.
Stupid mistake in rB6824ee0595c9dd7d1c18864f2 fix, again reported by
@campbellbarton, thanks.
2017-05-15 10:42:03 +02:00
8ce7b1376e Mesh Center: improved center-of-mass calculation
Previous method was based on face-area, giving un-even results
based on topology and gave issues with zero area faces.

This method gives matching results for concave ngons and the same geometry triangulated.
2017-05-15 10:42:03 +02:00
Julian Eisel
fd78016ecd UI: Add template_search (version of template_ID for non-IDs)
Adds a version of template_ID that can be used for non-ID properties.
The property to search for and the collection to search in has to be
passed to it.
Like template_ID it also takes arguments to define a 'new' and 'unlink'
operator. They will be displayed as icon-only buttons then.
Also added a version that can display preview thumbnails.

Had to do some additional changes to make text-buttons support
displaying/modifying empty RNA properties.

This will be needed for workspaces, see D2451.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D2666
2017-05-15 10:42:03 +02:00
59aa170c0f Fix T51449: empty node editor continuously redrawing and using CPU. 2017-05-15 10:42:03 +02:00
2ade6b29a9 Cleanup: Rename field 2017-05-11 19:51:05 +02:00
88028209a9 Merge branch 'blender2.8' into greasepencil-object 2017-05-11 19:11:48 +02:00
9aa62c1da5 Cleanup: Extract pixel scale function 2017-05-11 11:38:06 +02:00
8da8cdff41 Merge branch 'blender2.8' into greasepencil-object 2017-05-10 16:19:31 +02:00
4d3aaaaa79 Merge branch 'blender2.8' into greasepencil-object 2017-05-09 21:56:36 +02:00
a895e8e512 Use different points for stroke ends calculation
With old method the end of the stroke sometimes looked weird
2017-05-09 21:54:05 +02:00
495f1d7a6d Increase thickness limit range 2017-05-09 15:04:52 +02:00
319362dfbe Remove static matrix definition 2017-05-09 13:02:16 +02:00
16b24358fa Fix UI panel error 2017-05-09 12:47:26 +02:00
6d640fe48c Cleanup: Remove more unused vars 2017-05-09 11:08:16 +02:00
3a3a89704c Cleanup: Remove unused variables 2017-05-08 21:05:37 +02:00
a28bbb3fdb Merge branch 'blender2.8' into greasepencil-object 2017-05-08 20:45:13 +02:00
0925574c2c Add clamp support for textures
The texture is clamp using clamp of the UVs, because if we clamp the texture using GPU_texture_wrap_mode, any place where this texture is used would be affected.
2017-05-08 20:41:16 +02:00
7c4f6e8eae Fix missing textures when reload
The texture is not saved in texturelist and is passed directly to shader
2017-05-08 20:41:16 +02:00
Dalai Felinto
0d7fd2a08f More warnings cleanup 2017-05-08 14:55:22 +02:00
Dalai Felinto
cba86fbd77 Fixing gpencil screen drawing after warning cleanup
I find strange that this needs to be static, and can see this being an issue
for simultaneous drawing in the future. That said, better leave it
working as before.
2017-05-08 14:54:35 +02:00
Dalai Felinto
e93279dc06 Fix blenderplayer build 2017-05-08 14:46:38 +02:00
Dalai Felinto
7ec7f324a3 Fix build warnings
* gcc complain if you have a "main" variable
* Missing header include in gpencil_draw.w
* A few shadowed variables (we should avoid common names in (#define) macros)
* Clear ambiguity in (!flag & VALUE) -> ((flag & VALUE) == 0)
2017-05-08 14:37:09 +02:00
3135507683 Cleaunp code 2017-05-08 12:57:37 +02:00
8a74671466 Fix memory leak and access violation
The builtin shaders are free in blender close, so the engine must not free them. The memory leak was relatred to recreate the shaders again and again, so the free only use the last copy.
2017-05-08 12:53:36 +02:00
7b8b23d1ef Merge branch 'blender2.8' into greasepencil-object 2017-05-08 12:03:47 +02:00
525b869ba6 Some missing free memory for shaders 2017-05-06 20:27:17 +02:00
501da3a717 Merge branch 'blender2.8' into greasepencil-object 2017-05-06 18:34:56 +02:00
c468922eae Merge branch 'blender2.8' into greasepencil-object 2017-05-05 20:15:30 +02:00
5d8ef4ecba Check zdepth to avoid strokes in back of camera
Do not draw if the stroke ison  back of the point of view.
2017-05-05 16:29:33 +02:00
561668d590 Cleanup: Remove unused variables 2017-05-05 13:20:05 +02:00
7bfc1b7dbd Merge branch 'blender2.8' into greasepencil-object 2017-05-05 12:15:24 +02:00
291f49b0b2 Merge branch 'blender2.8' into greasepencil-object 2017-05-04 20:23:02 +02:00
71366b9f2a Cleanup: make code more compact 2017-05-03 16:45:48 +02:00
6ad29aaeec Increase thickness limit parameter 2017-05-03 16:41:33 +02:00
f5f93bc576 WIP: new method to calculate scale of the stroke thickness
The previous scale method was not valid because only was affected by viewport, but not by GP object or Stroke location. Now, the pixel size is calculated depending of zdepth and used to scale the stroke thickness.

Maybe there are other ways to do it, but this approach works, so we keep it before finding better methods
2017-05-03 16:31:23 +02:00
f6b2b2cf38 Merge branch 'blender2.8' into greasepencil-object 2017-05-02 22:25:23 +02:00
d906c6c056 Cleanup: Move scale code to function 2017-05-02 22:09:58 +02:00
9c65a99959 WIP: Apply scale to strokes thickness 2017-05-02 20:37:35 +02:00
ded0f9604e Merge branch 'blender2.8' into greasepencil-object 2017-05-01 16:20:05 +02:00
bafd64cbd9 Draw solid area while drawing for non solid colors
For these styles, the fill is simulated with a solid color that will be replaced when the stroke is completed
2017-04-27 19:04:03 +02:00
1632446deb Rename files to align with naming conventions for drawing engines 2017-04-27 12:29:52 +02:00
f49c960ce6 Merge branch 'blender2.8' into greasepencil-object 2017-04-27 11:45:19 +02:00
c5faa0b8eb Draw scene datablock using draw manager
The scene is drawn in the populate callback, and a flag is added to do it only once per drawing cycle.
2017-04-27 11:36:00 +02:00
28edc3f46f Remove duplicate character on previous commit 2017-04-25 23:10:36 +02:00
d80b3430a0 Cleanup: remove evil context for toolsettings 2017-04-25 23:09:44 +02:00
b568227c6a Cleanup: create function with all drawing steps
This separate the drawing function in order to prepare for drawing scene datablock
2017-04-25 23:07:28 +02:00
8cd8be2929 Reduce the use of context functions and use DRWContextState members 2017-04-25 23:00:27 +02:00
28b7848069 Adapt code to new context methods 2017-04-25 21:21:58 +02:00
546b73334f Merge branch 'blender2.8' into greasepencil-object 2017-04-25 20:49:16 +02:00
0367e13089 Merge branch 'blender2.8' into greasepencil-object 2017-04-24 22:16:07 +02:00
c9b0113c13 Fix problem with layer drawing order
The fill and stroke must be in the same pass to keep layer drawing order
2017-04-23 18:32:44 +02:00
2209f6e23a Add functions to draw strokes with one point only 2017-04-23 11:24:23 +02:00
c658e4ce1b WIP: Basic texture filling support
Pending to add more options
2017-04-22 20:13:34 +02:00
1397ff2a32 Fix problems after merge 2017-04-22 19:04:20 +02:00
f29c828b6d Cleanup: Remove unused shader definition 2017-04-22 19:03:53 +02:00
2165c0ce8f Merge branch 'blender2.8' into greasepencil-object 2017-04-22 18:28:42 +02:00
886d213a14 Draw buffer if stroke shaders are not loaded yet
This fix the problem for the first stroke in the frame
2017-04-22 18:18:19 +02:00
b2c97c978c Cleanup: Replace duplicate lines by helper function 2017-04-22 18:15:46 +02:00
a2dff88140 WIP: Add current stroke buffer to drawing manager
Pending to solve the error for first stroke before frame is created
2017-04-22 12:48:07 +02:00
637ce11895 Merge branch 'blender2.8' into greasepencil-object 2017-04-19 10:50:20 +02:00
dbf89fdd7a Merge branch 'blender2.8' into greasepencil-object 2017-04-18 19:22:00 +02:00
db97503540 Merge branch 'blender2.8' into greasepencil-object 2017-04-16 15:56:06 +02:00
b2c28127e2 Fix some errors in onion skins 2017-04-15 15:14:24 +02:00
834730e123 Separate in different passes 2017-04-14 19:47:27 +02:00
5049726be2 Prepare shaders for animation onion skin data 2017-04-14 19:07:32 +02:00
f9d0b63960 Reorganize strokes drawing code 2017-04-14 16:16:49 +02:00
780d62e774 Save parent matrix in bGPDlayer
It's faster a more efficient to save this drawing matrix by layer instead to allocate memory on the fly.
2017-04-14 12:54:34 +02:00
6008e08187 Merge branch 'blender2.8' into greasepencil-object 2017-04-14 12:15:54 +02:00
3dd7267d5a Remove duplicate function
Initially, the function to calculate the matrix was different, but now both are equal, so new function can be deleted.
2017-04-14 12:13:46 +02:00
371eaac9ee Merge branch 'blender2.8' into greasepencil-object 2017-04-13 19:43:17 +02:00
30a558bce5 When remove layer parent reset stroke position
With new design when a layer parent is removed, the stroke revert to original position without parenting.
2017-04-13 19:40:27 +02:00
a831b86bfe WIP: Add layer parenting
There are some memory  leaks
2017-04-13 18:32:53 +02:00
e3cefe5ed0 Add TODO for xray functionality 2017-04-13 17:52:06 +02:00
41afab8258 Cleanup: Use macro to free shaders 2017-04-13 15:31:08 +02:00
1348caa1ab Merge branch 'blender2.8' into greasepencil-object 2017-04-13 12:29:26 +02:00
4388bbf9d6 Remove inverse matrix in drawing
With new shaders, it is better to use a object global matrix and do not calculate for each point the position.
2017-04-13 12:20:34 +02:00
c810fdd5df WIP: Add basic editing points to strokes 2017-04-13 12:08:50 +02:00
3f00d9b8b8 Add new data_size new parameter and avoid error with null gp 2017-04-12 20:15:34 +02:00
c50bbd3ac4 Merge branch 'blender2.8' into greasepencil-object 2017-04-12 19:49:28 +02:00
80acd72bab Cleanup: Remove unused include and options 2017-04-12 12:52:06 +02:00
a6e89c5151 Fix problem with fill_style
The different memory size of the variable corrupted mix_factor
2017-04-12 12:36:45 +02:00
03df48a28a WIP: add basic support for stroke filling using draw_manager 2017-04-12 12:11:34 +02:00
16e9cf2bb3 Merge branch 'blender2.8' into greasepencil-object 2017-04-12 10:14:18 +02:00
3800421d6b Fix merge error
Due error during mergetool command, the merge was wrong in previous commit.
2017-04-11 21:33:32 +02:00
980205b539 Merge branch 'blender2.8' into greasepencil-object 2017-04-11 20:03:43 +02:00
14057b670d WIP: Add basic stroke drawing using new draw manager
The position is not correct and fill is still missing
2017-04-11 19:43:53 +02:00
6eecbca309 Disable again drawing
The functions aren't ready yet
2017-04-11 11:49:02 +02:00
8500772d77 Check layer and frame before drawing 2017-04-11 11:34:31 +02:00
a4afeeadea Add volumetric shader 2017-04-11 11:23:51 +02:00
33e88a51b6 Call gpencil engine from draw_manager 2017-04-10 21:59:27 +02:00
fb1559043a Create storage and small fixes 2017-04-10 21:59:09 +02:00
33078609df Merge branch 'blender2.8' into greasepencil-object 2017-04-10 19:36:45 +02:00
9219dd9137 Register gpencil engine in draw manager 2017-04-10 19:22:06 +02:00
935b954685 Fix typo error
When build shaders the linker fails due an error in glsl datatoc name
2017-04-10 19:21:41 +02:00
a1a7e3a10c Only draw strokes if active object is grease pencil 2017-04-10 13:34:40 +02:00
870568a0ef Replace GL_FLOAT 2017-04-10 13:33:09 +02:00
fca84238f6 Merge branch 'blender2.8' into greasepencil-object 2017-04-10 11:24:34 +02:00
ffd0c3e42a Replace VertexFormat_add_attrib types to new values 2017-04-09 18:20:18 +02:00
524abadae7 Merge branch 'blender2.8' into greasepencil-object 2017-04-09 16:56:52 +02:00
ef18c6080b First steps to create new drawing mode for gpencil
Created basic structure of the drawing mode, but pending of adding all functionality and link to draw manager.
2017-04-09 16:52:36 +02:00
100f5052d4 Change function name after rename of Gawain function 2017-04-06 16:36:32 +02:00
d14258fd3f Merge branch 'blender2.8' into greasepencil-object 2017-04-06 16:01:39 +02:00
0cc77b5492 Free new symbol memory
I forget include the memory free in previous commit
2017-04-05 19:12:11 +02:00
0d668cdf79 Merge branch 'blender2.8' into greasepencil-object 2017-04-05 17:39:22 +02:00
277d0891ff Add new draw manager symbol for new ob_gpencil object type 2017-04-05 16:50:12 +02:00
9f16b6606e Include class registration for scene GP panel
After the last changes in the classes registration, need add the class to the the list.
2017-04-04 13:27:34 +02:00
a29c0a5f81 Include ModelViewProjection matrix to use in the future
This will be used to calculate the stroke thickness
2017-04-04 12:44:59 +02:00
bf4c804309 Cleanup code 2017-04-01 11:35:18 +02:00
3a0c2a7555 Remove unused ARegion parameter
This parameter was added for new shaders, but finally is not used.
2017-04-01 11:27:59 +02:00
61fe9afd29 Remove scale factor for thickness
With the new draw manager, calculate the scale in the drawing is not a solution because the batch drawing need to include the scale calculation in the shader.

TODO: Add scale calculation to shader itself.
2017-04-01 11:16:29 +02:00
77f4152124 Move initialization code to new versioning file 2017-04-01 11:13:03 +02:00
c642a697e1 Merge branch 'blender2.8' into gpencil_2.8 2017-04-01 10:42:02 +02:00
e329f01c94 Cleanup: Remove variables for cyclic and use pointers 2017-03-31 12:33:37 +02:00
de2f450347 Cleanup: Reduce variable declaration 2017-03-31 12:26:41 +02:00
d97a79cfed Cleanup: Make code more compact 2017-03-31 12:19:14 +02:00
50f6683fc8 Cleanup: Remove extra space lines 2017-03-31 12:16:18 +02:00
9891e42411 Merge branch 'blender2.8' into gpencil_2.8 2017-03-31 11:37:40 +02:00
60fca1783c Add support for cyclic stroke 2017-03-30 17:47:29 +02:00
6886e79303 Cleanup: Rename screen var and change culling factor 2017-03-30 17:47:15 +02:00
f0ea3736df Add stroke culling to avoid weird lines 2017-03-30 17:00:54 +02:00
e987e81dd4 Change stroke scale 2017-03-30 17:00:27 +02:00
8ead0c13aa Merge branch 'blender2.8' into gpencil_2.8 2017-03-30 16:20:59 +02:00
e82b18dd61 Merge branch 'blender2.8' into gpencil_2.8 2017-03-29 16:58:23 +02:00
eecc29ec67 Add offset parameters 2017-03-29 13:30:23 +02:00
70dc128de5 Replace windows size by parameters 2017-03-29 11:16:29 +02:00
0aa9cf75ed Use RegionView3D matrix instead of general Opengl matrix 2017-03-29 10:56:57 +02:00
d15e3aaa62 Shader almost working 2017-03-28 20:29:50 +02:00
4bb7f4825b Merge branch 'blender2.8' into gpencil_2.8 2017-03-28 13:07:46 +02:00
a352c887e1 Basic geometry for strokes working
Pending to remove rotation of the matrix
2017-03-28 12:50:21 +02:00
c85c3ffa67 Remove culling 2017-03-28 12:17:56 +02:00
06577d60c0 Use Opengl constant 2017-03-28 11:29:05 +02:00
7875ab1b80 Merge branch 'blender2.8' into gpencil_2.8 2017-03-28 10:24:17 +02:00
c20e292121 Change primitive types and cleanup code 2017-03-27 16:50:09 +02:00
fc2a85bbe7 Add new shaders for strokes and prepare parameters.
Note: The shader is not used yet.
2017-03-25 18:35:48 +01:00
ec775eb02d Merge branch 'blender2.8' into gpencil_2.8 2017-03-25 10:57:36 +01:00
fce04156a3 Merge branch 'blender2.8' into gpencil_2.8 2017-03-24 11:19:41 +01:00
e6ce57af84 Adapt python modules to new registration method 2017-03-23 18:55:23 +01:00
808294212e Merge branch 'blender2.8' into gpencil_2.8 2017-03-23 16:21:59 +01:00
bbe6c25c39 Merge branch 'blender2.8' into gpencil_2.8 2017-03-21 18:43:31 +01:00
4b5ce6b0c5 Merge branch 'blender2.8' into gpencil_2.8 2017-03-18 15:27:59 +01:00
b2b0de5d89 Merge branch 'blender2.8' into gpencil_2.8 2017-03-15 18:23:48 +01:00
a556bf6f64 Merge branch 'blender2.8' into gpencil_2.8 2017-03-13 13:15:49 +01:00
fc0e5d56b8 New draw at last stroke location
This option at layer level allows to draw the new strokes using as origin the last layer stroke location. This is very useful in some drawings with layers at different zdepths.
2017-03-13 12:30:06 +01:00
82b387cc47 Merge branch 'blender2.8' into gpencil_2.8 2017-03-11 18:34:13 +01:00
352e62c9ef Fix identation error 2017-03-10 17:53:12 +01:00
c067661b58 Merge branch 'blender2.8' into gpencil_2.8 2017-03-10 17:13:35 +01:00
411021d320 New operator to convert scene gp datablock to gp object 2017-03-10 17:09:09 +01:00
9eaca59968 Improve poll method for Layers UI panel 2017-03-10 17:08:12 +01:00
7b048beb5b Update properties UI panel when change 2017-03-10 17:06:28 +01:00
51395e01c3 Merge branch 'blender2.8' into gpencil_2.8 2017-03-10 11:10:13 +01:00
8bfd2a83ff Draw strokes using sorting by zdepth
Now this implemented in legacy code. When final draw will be ready, this drawing must be moved.
2017-03-10 10:45:38 +01:00
754c7792c8 Merge branch 'blender2.8' into gpencil_2.8 2017-03-09 12:36:00 +01:00
e50d19592f Merge branch 'blender2.8' into gpencil_2.8 2017-03-09 12:07:47 +01:00
8c7ca30f83 Cleanup: make function static 2017-03-09 11:08:52 +01:00
d302de0f87 Avoid error in data panel if object is not GPencil 2017-03-08 20:26:06 +01:00
e1db32d95d Cleanup: Use correct function to multiply matrix rotation only 2017-03-08 16:39:51 +01:00
5cf91943bf Merge branch 'blender2.8' into gpencil_2.8 2017-03-08 15:41:54 +01:00
9be5a7db06 Change text for Cursor mode when using GP objects 2017-03-08 13:30:58 +01:00
aad28de5f9 Reproject stroke to axis using object location and rotation 2017-03-08 12:59:13 +01:00
c032946d9e Add new property to set origin as object location or 3d cursor 2017-03-08 12:03:49 +01:00
c0aec751ba Cleanup style 2017-03-08 11:01:13 +01:00
f02ba9ef46 Change symbol of GP object in viewport to make different of Empty 2017-03-08 10:45:51 +01:00
86b0d41122 Duplicate GP datablock for OB_GPENCIL objects 2017-03-07 11:41:08 +01:00
b541ff0ed3 Do not copy old palettes when duplicate GP data 2017-03-07 11:28:47 +01:00
43dcdcab8b Change default OB_GPENCIL size
Maybe, this could be a userprefs parameter
2017-03-07 10:53:37 +01:00
c40e5e0ff4 Merge branch 'blender2.8' into gpencil_2.8 2017-03-07 10:24:20 +01:00
94c63b977d Reorganize UI panels in other space types (not 3D view) 2017-03-06 19:23:00 +01:00
31120137dd Remove GP layers from properties panel in 3D view.
All the layer info has been moved to Properties Scene or Object
2017-03-06 19:03:26 +01:00
5bee75f9f6 Change Panel to use scene in properties if context is scene 2017-03-06 18:57:35 +01:00
4e16e0e53b Change panel class name to avoid conflicts 2017-03-06 13:09:16 +01:00
475d510bb3 Add GPencil Layer to Scene UI panel 2017-03-06 12:47:32 +01:00
40df4a2ea9 Remove unused parameters in UI panel for GP Object
The type of display is not used in GPencil object.
2017-03-06 12:34:20 +01:00
08a1fdbf01 Merge branch 'blender2.8' into gpencil_2.8 2017-03-06 11:45:09 +01:00
a5d09d8667 Add a call to draw gpencil object for 2D
As the current drawing action is 2D, we need to call the function for drawing.

All previous strokes are drawn in 3D because they are converted after finish each stroke from 2d to 3d.
2017-03-04 17:42:37 +01:00
75f931d4fa Fix error in transformation when object is rotated 2017-03-04 11:56:19 +01:00
00b6810b74 Initialize rotation of GPencil Objects 2017-03-04 11:39:24 +01:00
bcbf776a88 Return datablock for GPencil 2017-03-04 11:38:37 +01:00
ed183567c0 Cleanup code doing more compact if groups 2017-03-03 22:15:41 +01:00
5719f5fe38 Create an OB_GPENCIL object automatically if not selected a previous one 2017-03-03 22:15:20 +01:00
559a4b846f Modify creation of the object to remove unused RNA and define size in header file 2017-03-03 22:14:54 +01:00
968ce60270 Remove redundant lines 2017-03-03 22:14:41 +01:00
c089f2eecd Avoid wrong activation of edit mode 2017-03-03 22:14:36 +01:00
e2f258c1da Fix error to toggle to scene. Need more work to avoid conflicts among modes. 2017-03-03 22:14:29 +01:00
f7569a8eb8 Fix error in parameter list 2017-03-03 22:12:27 +01:00
0067d283ad Apply diff_mat to transformations 2017-03-03 21:55:02 +01:00
ba00f508fb Fix parameter list for interpolate functions 2017-03-03 21:54:35 +01:00
a9dcf0f158 Apply diff_mat always and not only when layer parented. If the matrix is not necessary, a unit matrix is generated. This keeps the code cleaner and can handle scene and OB_GPENCIL objects 2017-03-03 21:54:19 +01:00
3783c0ba54 Show parent in properties panel 2017-03-03 21:54:14 +01:00
7784028569 Basic parent to object modificaction. There are errors like double drawing and editing 2017-03-03 21:54:08 +01:00
9a1c977e09 Fix error in brackets 2017-03-03 21:53:32 +01:00
119417417d Basic drawing for all gp objects strokes in the scene 2017-03-03 21:53:25 +01:00
1a672025cf First step to move GP object info to properties panel. Some decision must be taken for scene strokes because this is not visible in properties. 2017-03-03 21:53:19 +01:00
f876c51b30 Cleanup brackets style 2017-03-03 21:40:28 +01:00
6a8ae2d61f Open new section for Gpencil in properties panel. The previous change for use empty panel for both has been undone 2017-03-03 21:40:04 +01:00
1d8cdec1ba Change icon for data when using OB_GPENCIL 2017-03-03 21:39:53 +01:00
b2769b4485 Enable TAB key for enter in edit mode for OB_GPENCIL objects 2017-03-03 21:39:47 +01:00
036dbc19b4 Enable Object mode by default when create a new OB_GPENCIL object 2017-03-03 21:39:39 +01:00
d88edf6284 Change lines due update in function paramaters 2017-03-03 21:37:14 +01:00
6da453a8d7 Set object mode before call operator from outliner 2017-03-03 21:36:53 +01:00
9ee464cab5 Call edit strokes from Outliner doing click over GP datablock of GPencil object 2017-03-03 21:36:44 +01:00
79ef8d57a0 Use new outliner icon for menus 2017-03-03 21:36:39 +01:00
77d66c4c5b First steps to create OB_GPENCIL object 2017-03-03 21:33:21 +01:00
8a30cb4c13 Fix error in vertex shader to make equal to fragment shader 2017-03-03 13:22:14 +01:00
178308a52e Fix error in shader to avoid deformations when rotate viewport 2017-03-03 13:17:00 +01:00
f1ae4af473 Use perfect squares as bounding box to get square UVs 2017-03-03 13:17:00 +01:00
ac415636eb Add new fields when copy palette color 2017-03-03 13:17:00 +01:00
d9d38e5698 Disable parameters not used by some types of filling 2017-03-03 13:17:00 +01:00
ff2cdfb1e5 Change radial gradient to use inner radius 2017-03-03 13:16:59 +01:00
9814c1df67 Fix radial center shader when apply scale 2017-03-03 13:16:59 +01:00
013503dfb5 Working filling shaders with flip and scale.
Need a better gradient algorithm
2017-03-03 13:16:59 +01:00
f23137f7b6 Include new parameter for texture opacity 2017-03-03 13:16:59 +01:00
21cdccf145 Mix texture with linear gradient 2017-03-03 13:16:59 +01:00
004979f7b0 Mix texture with solid fill 2017-03-03 13:16:59 +01:00
a646859a25 Cleanup UI panel to make more intuitive and remove unused params 2017-03-03 13:16:59 +01:00
ce3cdd66d8 New property to mix texture with fill color 2017-03-03 13:16:59 +01:00
bfa228dde2 Fix rotation for gradients and replace texture center variable 2017-03-03 13:16:59 +01:00
57e36df031 Rotate texture around center and not pivot point 2017-03-03 13:16:58 +01:00
2f9f0093d4 Fix radial gradient values 2017-03-03 13:16:58 +01:00
994c019b0d Make linear gradient full color when mix in extrem values.
This is very useful for artistic animations because is more easy to change mix factor than switch to solid color.
2017-03-03 13:16:58 +01:00
9abfa2245e Change UI panel to group options 2017-03-03 13:16:58 +01:00
cdfb7e6ee2 Enable fake_user for image texture used in filling 2017-03-03 13:16:58 +01:00
74dce7aa82 Relink texture images when load file 2017-03-03 13:16:58 +01:00
86d28f9dca Basic filling options working after a complete UI rework 2017-03-03 13:16:58 +01:00
40322007f1 Basic texture support 2017-03-03 13:16:58 +01:00
73a5b137df Add shift factor to radial filling 2017-03-03 13:16:58 +01:00
111a7b7214 Add new parameters for shift.
This modification is not compilable, need a change in Gawain.
2017-03-03 13:16:57 +01:00
3b2d16619c Make fill visible if style is not solid 2017-03-03 13:16:57 +01:00
4955e5e0ee New shift properties to move filling pattern 2017-03-03 13:16:57 +01:00
0661d620c9 First steps to create new radial gradient filling 2017-03-03 13:16:57 +01:00
e48a184506 Cleanup fragment shader code 2017-03-03 13:16:57 +01:00
2824a513be Add chessboard support 2017-03-03 13:16:57 +01:00
426341a3ea Add new functions to filling shader as angle and factor 2017-03-03 13:16:56 +01:00
690bce3c51 Add defines to more clear shader code 2017-03-03 13:16:55 +01:00
8fd58139ba View mix color only if gradient mode 2017-03-03 13:16:55 +01:00
2456e1ce35 New parameters to control gradient or solid fill 2017-03-03 13:16:55 +01:00
4f100f98e5 Cleanup spaces and comments 2017-03-03 13:16:54 +01:00
d72720f7d1 Cleanup comments 2017-03-03 13:16:54 +01:00
d77de3b25a Cleanup unused variables 2017-03-03 13:16:54 +01:00
2567b8f074 Fill shader working with basic gradient support.
The shaders now are for testing only to verify workflow, no real calculation.
2017-03-03 13:16:54 +01:00
0b491e5cda Make new functions static 2017-03-03 13:16:54 +01:00
c665a0bcfa Add a basic shader for filling strokes
The shader code is very basic for testing purpose only.
2017-03-03 13:16:53 +01:00
1e56ce1d9e Add new functions to calculate texture coordinates 2017-03-03 13:16:53 +01:00
c9e9783ba7 Define new fields for saving UV data for triangles 2017-03-03 13:16:53 +01:00
5e7959f964 Add better poll method
Change poll method to check if there is a gpd datablock
2017-03-03 13:16:53 +01:00
0b870bcccd Rename animation palette conversion function 2017-03-03 13:16:53 +01:00
e16eb9b875 Fix comment typo error 2017-03-03 13:16:53 +01:00
c28dca20b7 Depsgraph: Remove unused owner argument for palette builder 2017-03-03 13:16:53 +01:00
39a45edb0d Cleanup: Fix merge error 2017-03-03 13:16:53 +01:00
df223b6c5d Move the palette versioning code outside 2.78.4 area.
This code must be included in next version area.
2017-03-03 13:16:53 +01:00
c9ede7b02f Cleanup code a remove unused driver conversion.
The old GP does not support drivers.
2017-03-03 13:16:53 +01:00
ee5c40137b Remove drivers conversion 2017-03-03 13:16:52 +01:00
3cb7c4f47a Fix merge error 2017-03-03 13:16:52 +01:00
6ca9ca7ce2 Functon to convert animation for Palettes.
Used by operator
2017-03-03 13:16:52 +01:00
b01e763c93 Operator to run palette animation conversion 2017-03-03 13:16:52 +01:00
592748176f New functions to look color by RGB and RGBA 2017-03-03 13:16:52 +01:00
8a8c2e9ebe Free animation memory when free Palettes 2017-03-03 13:16:52 +01:00
e7eee9f36e Include palettes evaluation in new desgraph system 2017-03-03 13:16:52 +01:00
3db6a3a069 Fix animation after renaming color. 2017-03-03 13:16:52 +01:00
dfa81bbdde Remove previous fix for particles animation type 2017-03-03 13:16:52 +01:00
07e219ecde Add new include file due changes in libraries 2017-03-03 13:16:52 +01:00
8f182f6571 Fix previous commit. This definition is required to compile, but it is not used and must be moved or removed when particles back. 2017-03-03 13:16:51 +01:00
a737ee4e82 Some changes to try to include in dopesheet 2017-03-03 13:16:51 +01:00
5e13609a8f Create new channel definition for Palette 2017-03-03 13:16:51 +01:00
3d2766bf08 Include palette keyframes in timeline keyframe_jump operator 2017-03-03 13:16:51 +01:00
08ded0dc73 Initial Timeline editor working without crash. Need more work 2017-03-03 13:16:51 +01:00
e5a50ffffa Add flag to use in action editors 2017-03-03 13:16:51 +01:00
8296f4a13d Include filter for palettes in Dopesheet 2017-03-03 13:16:51 +01:00
248228a716 Include palette keyframes in Timeline Editor 2017-03-03 13:16:50 +01:00
372c92e6c6 Changes to make Palettes animatable. Pending link to new desgraph.
I have only created the methods build_palette for deg_builder_relations.cc and deg_builder_nodes.cc
2017-03-03 13:16:50 +01:00
d4dda54de8 Fix error when create a non GP color after the creation of GP color.
The flag remained true, so the operator worked iqual for color for vertex paint, etc.
2017-03-03 13:16:50 +01:00
8e65fd271c Copy pass index when copy a color 2017-03-03 13:16:50 +01:00
102adeaa0b Use full row for pass_index property 2017-03-03 13:16:50 +01:00
2ad7e98c6a Change style text to avoid duplicate stroke and fill word 2017-03-03 13:16:50 +01:00
624c801a26 Replace use_volumetric as a stroke style and not as independent option 2017-03-03 13:16:50 +01:00
23d27375cd Include temporary styles for drawing buffer 2017-03-03 13:16:50 +01:00
92f59b8473 Copy new style flags when change palette 2017-03-03 13:16:49 +01:00
8c344bbf23 Copy styles when copy color 2017-03-03 13:16:49 +01:00
0822e5a3ed Include new fields for styles. These fields are not used today, but they will be used in the future with new styles like gradient, dotted, etc. 2017-03-03 13:16:49 +01:00
1424079029 Include Index Pass for future uses 2017-03-03 13:16:49 +01:00
fe46c4d1e9 Fix error checking if color list is empty 2017-03-03 13:16:49 +01:00
c5a76620f8 Remove all RNA data about bGPDpalettes and bGPDpalettecolors 2017-03-03 13:16:49 +01:00
a1bc723468 New context functions for palettes and colors 2017-03-03 13:16:49 +01:00
30179bfc01 Fix problem with rna_path function 2017-03-03 13:16:49 +01:00
638b32bc76 Remove bGPDpalettes from RNA 2017-03-03 13:16:48 +01:00
a19df1ddfd Cleanup sentences order 2017-03-03 13:16:48 +01:00
e6388a2823 Set first color as active after palette conversion 2017-03-03 13:16:48 +01:00
8509211f6b Conver old bGPDpalettes to new BelnderPalettes 2017-03-03 13:16:48 +01:00
e56e3e7204 Create a dummy palette if the datablock is missing 2017-03-03 13:16:48 +01:00
ad1cb2156f Replace operator options description 2017-03-03 13:16:48 +01:00
79387b1e64 Add new palette change operator to UI panel and fix paint error 2017-03-03 13:16:47 +01:00
269adbb9f9 Create a new operator to change the palette 2017-03-03 13:16:45 +01:00
0ce48cc056 Do not save old bGPDpalette and bGPDpalettecolor data. These structs have been replaced by Blender Palettes and colors 2017-03-03 13:16:44 +01:00
b4e2a57d39 Fix problem to save and restore colors. Now the palettes pointer is included in the stroke in order to be able to reset the color pointer.
I have fixed the problem with some RNA that were connected to bGPDpalettecolor and not to PaletteColor
2017-03-03 13:16:44 +01:00
b0553d2134 Save and relink animation data for Palettes 2017-03-03 13:16:44 +01:00
f447c8115a When join, do not force a color recalc 2017-03-03 13:16:44 +01:00
12e7449d1d Fix error in previous commit 2017-03-03 13:16:44 +01:00
5575a235b7 Remove Color name from RNA properties 2017-03-03 13:16:44 +01:00
47643aef33 Remove special context for Grease Pencil and use a more general context 2017-03-03 13:16:43 +01:00
d658407ca2 Remove parameter ToolSettings not used anymore 2017-03-03 13:16:43 +01:00
b1e1aa5318 Remove get color by name and use the gps->palcolor pointer 2017-03-03 13:16:43 +01:00
88623c0cfa Use more general paint and palette context instead of gpencil context 2017-03-03 13:16:43 +01:00
d7a7061b72 Use PaletteColor and not colorname to determine the colors to delete or change. This is necessary because now we can use several palettes at the same time and the color name can be equal in two or more palettes. 2017-03-03 13:16:43 +01:00
98e9d54874 Make palettes visibles without GPD datablock 2017-03-03 13:16:43 +01:00
25aa0d8ca0 Enable basic support for PaletteColor animation 2017-03-03 13:16:43 +01:00
0e2a707f0d Fix error when remove colors and draw again 2017-03-03 13:16:42 +01:00
82ad438c9a Remove HQ_FILL. Now always is high quality fill 2017-03-03 13:16:42 +01:00
a59b0960ec Cleanup: Changes in parameter list and function names to fix several compiler warnings 2017-03-03 13:16:42 +01:00
fc9169eb7f Cleanup: Remove unused functions 2017-03-03 13:16:42 +01:00
53bdcad097 Cleanup: Remove unused definitions 2017-03-03 13:16:42 +01:00
252e5afe4c Remove creation options for old palette system to avoid future errors 2017-03-03 13:16:42 +01:00
bbb7ae617e Remove last bGPDpalette and bGPDpalettecolor operators 2017-03-03 13:16:42 +01:00
2e93bf8432 Python modified to apply new BlenderPalettes in Tools panel 2017-03-03 13:16:41 +01:00
2b1edb4728 Rename operator 2017-03-03 13:16:41 +01:00
15ae52e90f Change operator name 2017-03-03 13:16:41 +01:00
51c85f7445 Publish active index property 2017-03-03 13:16:41 +01:00
4a4276871d New operators moved from grease pencil to Palette and PaletteColor 2017-03-03 13:16:41 +01:00
da051bc210 Remove bGPdpalette and bGPdpalettecolor operators 2017-03-03 13:16:41 +01:00
3308a96e3b Change function name to keep name consistency 2017-03-03 13:16:41 +01:00
935217e48c Basic change of bGPDpalette and bGPDpalettecolor to Palette and PaletteColor 2017-03-03 13:16:40 +01:00
28117030f1 New fucntion to retrieve color using toolsettings 2017-03-03 13:16:40 +01:00
85ef68aec4 Include palette in temporary area for painting and interpolate operators 2017-03-03 13:16:40 +01:00
e8cc2b74f1 New operator to create grease pencil palette. This operator is used in template_ID in python to create the palette in imapaint and not relative to context 2017-03-03 13:16:39 +01:00
5350475214 Several changes in context functions to make it more reliable 2017-03-03 13:16:39 +01:00
99fb0f90ff Create new operator for new palettes for grease pencil 2017-03-03 13:16:39 +01:00
4374aa531e Create palette in temp data while drawing 2017-03-03 13:16:39 +01:00
e665042bc9 Wrapper function to create a new palette in context 2017-03-03 13:16:38 +01:00
3f36cdad4d Wrapper function to get color from context in one step 2017-03-03 13:16:38 +01:00
3a52e3c2ac Delete stroke if remove the color from palette 2017-03-03 13:16:38 +01:00
bfe90e00bb Cleanup active functions and rename to keep consistency with previous code 2017-03-03 13:16:38 +01:00
e12a0f2148 Create new BKE functions to get active palette and palettecolor. Update CTX_ functions to use new kernel functions 2017-03-03 13:16:38 +01:00
fd28c06260 Add Animation struct to palettes 2017-03-03 13:16:38 +01:00
ad83162ed7 Create new context functions for Palette and PaletteColor to expose values 2017-03-03 13:16:38 +01:00
968772303f Rename color for all GPD datablocks 2017-03-03 13:16:37 +01:00
ad0d83b518 Get color by name 2017-03-03 13:16:37 +01:00
71b71a0b92 Basic changes to include new grease pencil fields in palette colors 2017-03-03 13:16:37 +01:00
1676 changed files with 51608 additions and 43537 deletions

View File

@@ -42,3 +42,12 @@ insert_final_newline = true
indent_style = space
indent_size = 3
max_line_length = 120
# Makefile
[{Makefile,GNUmakefile}]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 4
max_line_length = 120

View File

@@ -157,8 +157,9 @@ option(WITH_BLENDER "Build blender (disable to build only the blender player)" O
mark_as_advanced(WITH_BLENDER)
if(APPLE)
# Currently this causes a build error linking, disable.
set(WITH_BLENDER_THUMBNAILER OFF)
# In future, can be used with `quicklookthumbnailing/qlthumbnailreply` to create file
# thumbnails for say Finder. Turn it off for now.
option(WITH_BLENDER_THUMBNAILER "Build \"blender-thumbnailer\" thumbnail extraction utility" OFF)
elseif(WIN32)
option(WITH_BLENDER_THUMBNAILER "Build \"BlendThumb.dll\" helper for Windows explorer integration" ON)
else()
@@ -273,11 +274,13 @@ endif()
if(UNIX AND NOT APPLE)
option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" OFF)
option(WITH_SYSTEM_GLES "Use OpenGL ES library provided by the operating system" ON)
option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" OFF)
option(WITH_SYSTEM_FREETYPE "Use the freetype library provided by the operating system" OFF)
else()
# not an option for other OS's
set(WITH_SYSTEM_GLEW OFF)
set(WITH_SYSTEM_GLES OFF)
set(WITH_SYSTEM_FREETYPE OFF)
endif()
@@ -536,12 +539,14 @@ option(WITH_OPENGL "When off limits visibility of the opengl header
option(WITH_GLEW_ES "Switches to experimental copy of GLEW that has support for OpenGL ES. (temporary option for development purposes)" OFF)
option(WITH_GL_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, glX, or WGL)" OFF)
option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (through either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
option(WITH_GPU_SHADER_BUILDER "Shader builder is a developer option enabling linting on GLSL during compilation" OFF)
mark_as_advanced(
WITH_OPENGL
WITH_GLEW_ES
WITH_GL_EGL
WITH_GL_PROFILE_ES20
WITH_GPU_SHADER_BUILDER
)
if(WIN32)
@@ -567,6 +572,10 @@ if(UNIX AND NOT APPLE)
option(WITH_LINKER_LLD "Use ld.lld linker which is usually faster than ld.gold" OFF)
mark_as_advanced(WITH_LINKER_LLD)
endif()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
option(WITH_LINKER_MOLD "Use ld.mold linker which is usually faster than ld.gold & ld.lld." OFF)
mark_as_advanced(WITH_LINKER_MOLD)
endif()
endif()
option(WITH_COMPILER_ASAN "Build and link against address sanitizer (only for Debug & RelWithDebInfo targets)." OFF)
@@ -677,7 +686,7 @@ if(WIN32 OR XCODE)
option(IDE_GROUP_PROJECTS_IN_FOLDERS "Organize the projects according to source folder structure." ON)
mark_as_advanced(IDE_GROUP_PROJECTS_IN_FOLDERS)
if (IDE_GROUP_PROJECTS_IN_FOLDERS)
if(IDE_GROUP_PROJECTS_IN_FOLDERS)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif()
endif()
@@ -702,9 +711,12 @@ if(UNIX AND NOT APPLE)
endif()
# Installation process.
option(POSTINSTALL_SCRIPT "Run given CMake script after installation process" OFF)
set(POSTINSTALL_SCRIPT "" CACHE FILEPATH "Run given CMake script after installation process")
mark_as_advanced(POSTINSTALL_SCRIPT)
set(POSTCONFIGURE_SCRIPT "" CACHE FILEPATH "Run given CMake script as the last step of CMake configuration")
mark_as_advanced(POSTCONFIGURE_SCRIPT)
# end option(...)
@@ -2068,3 +2080,8 @@ endif()
if(0)
print_all_vars()
endif()
# Should be the last step of configuration.
if(POSTCONFIGURE_SCRIPT)
include(${POSTCONFIGURE_SCRIPT})
endif()

View File

@@ -1,6 +1,3 @@
# -*- mode: gnumakefile; tab-width: 4; indent-tabs-mode: t; -*-
# vim: tabstop=4
#
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or

View File

@@ -63,6 +63,7 @@ include(cmake/jpeg.cmake)
include(cmake/blosc.cmake)
include(cmake/pthreads.cmake)
include(cmake/openexr.cmake)
include(cmake/brotli.cmake)
include(cmake/freetype.cmake)
include(cmake/freeglut.cmake)
include(cmake/glew.cmake)

View File

@@ -25,8 +25,13 @@ else()
endif()
if(WIN32)
set(BOOST_TOOLSET toolset=msvc-14.1)
set(BOOST_COMPILER_STRING -vc141)
if(MSVC_VERSION GREATER_EQUAL 1920) # 2019
set(BOOST_TOOLSET toolset=msvc-14.2)
set(BOOST_COMPILER_STRING -vc142)
else() # 2017
set(BOOST_TOOLSET toolset=msvc-14.1)
set(BOOST_COMPILER_STRING -vc141)
endif()
set(BOOST_CONFIGURE_COMMAND bootstrap.bat)
set(BOOST_BUILD_COMMAND b2)

View File

@@ -0,0 +1,38 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(BROTLI_EXTRA_ARGS
)
ExternalProject_Add(external_brotli
URL file://${PACKAGE_DIR}/${BROTLI_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${BROTLI_HASH_TYPE}=${BROTLI_HASH}
PREFIX ${BUILD_DIR}/brotli
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/brotli ${DEFAULT_CMAKE_FLAGS} ${BROTLI_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/brotli
)
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_brotli after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/brotli/include ${HARVEST_TARGET}/brotli/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/brotli/lib/brotlidec-static${LIBEXT} ${HARVEST_TARGET}/brotli/lib/brotlidec-static${LIBEXT}
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/brotli/lib/brotlicommon-static${LIBEXT} ${HARVEST_TARGET}/brotli/lib/brotlicommon-static${LIBEXT}
DEPENDEES install
)
endif()

View File

@@ -94,3 +94,4 @@ download_source(POTRACE)
download_source(HARU)
download_source(ZSTD)
download_source(FLEX)
download_source(BROTLI)

View File

@@ -19,13 +19,13 @@
set(FREETYPE_EXTRA_ARGS
-DCMAKE_RELEASE_POSTFIX:STRING=2ST
-DCMAKE_DEBUG_POSTFIX:STRING=2ST_d
-DWITH_BZip2=OFF
-DWITH_HarfBuzz=OFF
-DFT_WITH_HARFBUZZ=OFF
-DFT_WITH_BZIP2=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE)
-DFT_DISABLE_BZIP2=ON
-DFT_DISABLE_HARFBUZZ=ON
-DFT_DISABLE_PNG=ON
-DFT_REQUIRE_BROTLI=ON
-DPC_BROTLIDEC_INCLUDEDIR=${LIBDIR}/brotli/include
-DPC_BROTLIDEC_LIBDIR=${LIBDIR}/brotli/lib
)
ExternalProject_Add(external_freetype
URL file://${PACKAGE_DIR}/${FREETYPE_FILE}
@@ -36,6 +36,11 @@ ExternalProject_Add(external_freetype
INSTALL_DIR ${LIBDIR}/freetype
)
add_dependencies(
external_freetype
external_brotli
)
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_freetype after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/freetype

View File

@@ -79,6 +79,8 @@ endfunction()
harvest(alembic/include alembic/include "*.h")
harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
harvest(alembic/bin alembic/bin "*")
harvest(brotli/include brotli/include "*.h")
harvest(brotli/lib brotli/lib "*.a")
harvest(boost/include boost/include "*")
harvest(boost/lib boost/lib "*.a")
harvest(ffmpeg/include ffmpeg/include "*.h")

View File

@@ -31,7 +31,7 @@ ExternalProject_Add(external_python_site_packages
CONFIGURE_COMMAND ${PIP_CONFIGURE_COMMAND}
BUILD_COMMAND ""
PREFIX ${BUILD_DIR}/site_packages
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install ${SITE_PACKAGES_EXTRA} cython==${CYTHON_VERSION} idna==${IDNA_VERSION} charset-normalizer==${CHARSET_NORMALIZER_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} zstandard==${ZSTANDARD_VERSION} --no-binary :all:
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install --no-cache-dir ${SITE_PACKAGES_EXTRA} cython==${CYTHON_VERSION} idna==${IDNA_VERSION} charset-normalizer==${CHARSET_NORMALIZER_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} zstandard==${ZSTANDARD_VERSION} --no-binary :all:
)
if(USE_PIP_NUMPY)

View File

@@ -83,9 +83,9 @@ else()
set(OPENEXR_VERSION_POSTFIX)
endif()
set(FREETYPE_VERSION 2.10.2)
set(FREETYPE_VERSION 2.11.1)
set(FREETYPE_URI http://prdownloads.sourceforge.net/freetype/freetype-${FREETYPE_VERSION}.tar.gz)
set(FREETYPE_HASH b1cb620e4c875cd4d1bfa04945400945)
set(FREETYPE_HASH bd4e3b007474319909a6b79d50908e85)
set(FREETYPE_HASH_TYPE MD5)
set(FREETYPE_FILE freetype-${FREETYPE_VERSION}.tar.gz)
@@ -189,11 +189,11 @@ set(OSL_HASH 1abd7ce40481771a9fa937f19595d2f2)
set(OSL_HASH_TYPE MD5)
set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz)
set(PYTHON_VERSION 3.9.7)
set(PYTHON_SHORT_VERSION 3.9)
set(PYTHON_SHORT_VERSION_NO_DOTS 39)
set(PYTHON_VERSION 3.10.2)
set(PYTHON_SHORT_VERSION 3.10)
set(PYTHON_SHORT_VERSION_NO_DOTS 310)
set(PYTHON_URI https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz)
set(PYTHON_HASH fddb060b483bc01850a3f412eea1d954)
set(PYTHON_HASH 14e8c22458ed7779a1957b26cde01db9)
set(PYTHON_HASH_TYPE MD5)
set(PYTHON_FILE Python-${PYTHON_VERSION}.tar.xz)
@@ -215,18 +215,20 @@ set(NANOVDB_HASH e7b9e863ec2f3b04ead171dec2322807)
set(NANOVDB_HASH_TYPE MD5)
set(NANOVDB_FILE nano-vdb-${NANOVDB_GIT_UID}.tar.gz)
set(IDNA_VERSION 3.2)
set(CHARSET_NORMALIZER_VERSION 2.0.6)
set(URLLIB3_VERSION 1.26.7)
set(IDNA_VERSION 3.3)
set(CHARSET_NORMALIZER_VERSION 2.0.10)
set(URLLIB3_VERSION 1.26.8)
set(CERTIFI_VERSION 2021.10.8)
set(REQUESTS_VERSION 2.26.0)
set(CYTHON_VERSION 0.29.24)
set(ZSTANDARD_VERSION 0.15.2 )
set(REQUESTS_VERSION 2.27.1)
set(CYTHON_VERSION 0.29.26)
# The version of the zstd library used to build the Python package should match ZSTD_VERSION defined below.
# At this time of writing, 0.17.0 was already released, but built against zstd 1.5.1, while we use 1.5.0.
set(ZSTANDARD_VERSION 0.16.0)
set(NUMPY_VERSION 1.21.2)
set(NUMPY_SHORT_VERSION 1.21)
set(NUMPY_VERSION 1.22.0)
set(NUMPY_SHORT_VERSION 1.22)
set(NUMPY_URI https://github.com/numpy/numpy/releases/download/v${NUMPY_VERSION}/numpy-${NUMPY_VERSION}.zip)
set(NUMPY_HASH 5638d5dae3ca387be562912312db842e)
set(NUMPY_HASH 252de134862a27bd66705d29622edbfe)
set(NUMPY_HASH_TYPE MD5)
set(NUMPY_FILE numpy-${NUMPY_VERSION}.zip)
@@ -456,9 +458,9 @@ set(NASM_HASH aded8b796c996a486a56e0515c83e414116decc3b184d88043480b32eb0a8589)
set(NASM_HASH_TYPE SHA256)
set(NASM_FILE nasm-${NASM_VERSION}.tar.gz)
set(XR_OPENXR_SDK_VERSION 1.0.17)
set(XR_OPENXR_SDK_VERSION 1.0.22)
set(XR_OPENXR_SDK_URI https://github.com/KhronosGroup/OpenXR-SDK/archive/release-${XR_OPENXR_SDK_VERSION}.tar.gz)
set(XR_OPENXR_SDK_HASH bf0fd8828837edff01047474e90013e1)
set(XR_OPENXR_SDK_HASH a2623ebab3d0b340bc16311b14f02075)
set(XR_OPENXR_SDK_HASH_TYPE MD5)
set(XR_OPENXR_SDK_FILE OpenXR-SDK-${XR_OPENXR_SDK_VERSION}.tar.gz)
@@ -500,3 +502,9 @@ set(ZSTD_FILE zstd-${ZSTD_VERSION}.tar.gz)
set(SSE2NEON_GIT https://github.com/DLTcollab/sse2neon.git)
set(SSE2NEON_GIT_HASH fe5ff00bb8d19b327714a3c290f3e2ce81ba3525)
set(BROTLI_VERSION v1.0.9)
set(BROTLI_URI https://github.com/google/brotli/archive/refs/tags/${BROTLI_VERSION}.tar.gz)
set(BROTLI_HASH f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46)
set(BROTLI_HASH_TYPE SHA256)
set(BROTLI_FILE brotli-${BROTLI_VERSION}.tar.gz)

View File

@@ -379,27 +379,27 @@ USE_CXX11=true
CLANG_FORMAT_VERSION_MIN="6.0"
CLANG_FORMAT_VERSION_MEX="10.0"
PYTHON_VERSION="3.9.7"
PYTHON_VERSION_SHORT="3.9"
PYTHON_VERSION_MIN="3.7"
PYTHON_VERSION_MEX="3.11"
PYTHON_VERSION="3.10.2"
PYTHON_VERSION_SHORT="3.10"
PYTHON_VERSION_MIN="3.9"
PYTHON_VERSION_MEX="3.12"
PYTHON_VERSION_INSTALLED=$PYTHON_VERSION_SHORT
PYTHON_FORCE_BUILD=false
PYTHON_FORCE_REBUILD=false
PYTHON_SKIP=false
# Additional Python modules.
PYTHON_IDNA_VERSION="3.2"
PYTHON_IDNA_VERSION="3.3"
PYTHON_IDNA_VERSION_MIN="2.0"
PYTHON_IDNA_VERSION_MEX="4.0"
PYTHON_IDNA_NAME="idna"
PYTHON_CHARSET_NORMALIZER_VERSION="2.0.6"
PYTHON_CHARSET_NORMALIZER_VERSION="2.0.10"
PYTHON_CHARSET_NORMALIZER_VERSION_MIN="2.0.6"
PYTHON_CHARSET_NORMALIZER_VERSION_MEX="2.1.0" # requests uses `charset_normalizer~=2.0.0`
PYTHON_CHARSET_NORMALIZER_NAME="charset-normalizer"
PYTHON_URLLIB3_VERSION="1.26.7"
PYTHON_URLLIB3_VERSION="1.26.8"
PYTHON_URLLIB3_VERSION_MIN="1.0"
PYTHON_URLLIB3_VERSION_MEX="2.0"
PYTHON_URLLIB3_NAME="urllib3"
@@ -409,17 +409,17 @@ PYTHON_CERTIFI_VERSION_MIN="2021.0"
PYTHON_CERTIFI_VERSION_MEX="2023.0"
PYTHON_CERTIFI_NAME="certifi"
PYTHON_REQUESTS_VERSION="2.23.0"
PYTHON_REQUESTS_VERSION="2.27.1"
PYTHON_REQUESTS_VERSION_MIN="2.0"
PYTHON_REQUESTS_VERSION_MEX="3.0"
PYTHON_REQUESTS_NAME="requests"
PYTHON_ZSTANDARD_VERSION="0.15.2"
PYTHON_ZSTANDARD_VERSION="0.16.0"
PYTHON_ZSTANDARD_VERSION_MIN="0.15.2"
PYTHON_ZSTANDARD_VERSION_MEX="0.16.0"
PYTHON_ZSTANDARD_VERSION_MEX="0.20.0"
PYTHON_ZSTANDARD_NAME="zstandard"
PYTHON_NUMPY_VERSION="1.21.2"
PYTHON_NUMPY_VERSION="1.22.0"
PYTHON_NUMPY_VERSION_MIN="1.14"
PYTHON_NUMPY_VERSION_MEX="2.0"
PYTHON_NUMPY_NAME="numpy"
@@ -492,14 +492,14 @@ OIIO_SKIP=false
LLVM_VERSION="12.0.0"
LLVM_VERSION_SHORT="12.0"
LLVM_VERSION_MIN="11.0"
LLVM_VERSION_MEX="13.0"
LLVM_VERSION_MEX="14.0"
LLVM_VERSION_FOUND=""
LLVM_FORCE_BUILD=false
LLVM_FORCE_REBUILD=false
LLVM_SKIP=false
# OSL needs to be compiled for now!
OSL_VERSION="1.11.14.1"
OSL_VERSION="1.11.17.0"
OSL_VERSION_SHORT="1.11"
OSL_VERSION_MIN="1.11"
OSL_VERSION_MEX="2.0"
@@ -579,7 +579,7 @@ FFMPEG_FORCE_REBUILD=false
FFMPEG_SKIP=false
_ffmpeg_list_sep=";"
XR_OPENXR_VERSION="1.0.17"
XR_OPENXR_VERSION="1.0.22"
XR_OPENXR_VERSION_SHORT="1.0"
XR_OPENXR_VERSION_MIN="1.0.8"
XR_OPENXR_VERSION_MEX="2.0"
@@ -1116,7 +1116,7 @@ FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
XR_OPENXR_USE_REPO=false
XR_OPENXR_SOURCE=("https://github.com/KhronosGroup/OpenXR-SDK/archive/release-${XR_OPENXR_VERSION}.tar.gz")
XR_OPENXR_SOURCE_REPO=("https://github.com/KhronosGroup/OpenXR-SDK.git")
XR_OPENXR_REPO_UID="bf21ccb1007bb531b45d9978919a56ea5059c245"
XR_OPENXR_REPO_UID="458984d7f59d1ae6dc1b597d94b02e4f7132eaba"
XR_OPENXR_REPO_BRANCH="master"
# C++11 is required now
@@ -3620,8 +3620,8 @@ compile_FFmpeg() {
fi
./configure --cc="gcc -Wl,--as-needed" \
--extra-ldflags="-pthread -static-libgcc" \
--prefix=$_inst --enable-static \
--extra-ldflags="-pthread" \
--prefix=$_inst --enable-shared \
--disable-ffplay --disable-doc \
--enable-gray \
--enable-avfilter --disable-vdpau \
@@ -4036,14 +4036,14 @@ install_DEB() {
INFO "Forced Python building, as requested..."
_do_compile_python=true
else
check_package_version_ge_lt_DEB python3-dev $PYTHON_VERSION_MIN $PYTHON_VERSION_MEX
check_package_version_ge_lt_DEB python${PYTHON_VERSION_SHORT}-dev $PYTHON_VERSION_MIN $PYTHON_VERSION_MEX
if [ $? -eq 0 ]; then
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_DEB python3-dev` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
install_packages_DEB python3-dev
install_packages_DEB python${PYTHON_VERSION_SHORT}-dev
clean_Python
PRINT ""
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_DEB python${PYTHON_VERSION_SHORT}-dev` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
for module in "${PYTHON_MODULES_PACKAGES[@]}"
do
module=($module)
@@ -4681,11 +4681,11 @@ install_RPM() {
else
check_package_version_ge_lt_RPM python3-devel $PYTHON_VERSION_MIN $PYTHON_VERSION_MEX
if [ $? -eq 0 ]; then
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_RPM python3-devel` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
install_packages_RPM python3-devel
clean_Python
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_RPM python3-devel` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
for module in "${PYTHON_MODULES_PACKAGES[@]}"
do
module=($module)
@@ -5224,12 +5224,12 @@ install_ARCH() {
else
check_package_version_ge_lt_ARCH python $PYTHON_VERSION_MIN $PYTHON_VERSION_MEX
if [ $? -eq 0 ]; then
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_ARCH python` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
install_packages_ARCH python
clean_Python
PRINT ""
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_ARCH python` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
for module in "${PYTHON_MODULES_PACKAGES[@]}"
do
module=($module)
@@ -5721,76 +5721,6 @@ install_OTHER() {
# ----------------------------------------------------------------------------
# Printing User Info
print_info_ffmpeglink_DEB() {
dpkg -L $_packages | grep -e ".*\/lib[^\/]\+\.so" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
}
print_info_ffmpeglink_RPM() {
rpm -ql $_packages | grep -e ".*\/lib[^\/]\+\.so" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
}
print_info_ffmpeglink_ARCH() {
pacman -Ql $_packages | grep -e ".*\/lib[^\/]\+\.so$" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
}
print_info_ffmpeglink() {
# This func must only print a ';'-separated list of libs...
if [ -z "$DISTRO" ]; then
ERROR "Failed to detect distribution type"
exit 1
fi
# Create list of packages from which to get libs names...
_packages=""
if [ "$THEORA_USE" = true ]; then
_packages="$_packages $THEORA_DEV"
fi
if [ "$VORBIS_USE" = true ]; then
_packages="$_packages $VORBIS_DEV"
fi
if [ "$OGG_USE" = true ]; then
_packages="$_packages $OGG_DEV"
fi
if [ "$XVID_USE" = true ]; then
_packages="$_packages $XVID_DEV"
fi
if [ "$VPX_USE" = true ]; then
_packages="$_packages $VPX_DEV"
fi
if [ "$OPUS_USE" = true ]; then
_packages="$_packages $OPUS_DEV"
fi
if [ "$MP3LAME_USE" = true ]; then
_packages="$_packages $MP3LAME_DEV"
fi
if [ "$X264_USE" = true ]; then
_packages="$_packages $X264_DEV"
fi
if [ "$OPENJPEG_USE" = true ]; then
_packages="$_packages $OPENJPEG_DEV"
fi
if [ "$DISTRO" = "DEB" ]; then
print_info_ffmpeglink_DEB
elif [ "$DISTRO" = "RPM" ]; then
print_info_ffmpeglink_RPM
elif [ "$DISTRO" = "ARCH" ]; then
print_info_ffmpeglink_ARCH
# XXX TODO!
else
PRINT "<Could not determine additional link libraries needed for ffmpeg, replace this by valid list of libs...>"
fi
}
print_info() {
PRINT ""
PRINT ""
@@ -6002,12 +5932,10 @@ print_info() {
if [ "$FFMPEG_SKIP" = false ]; then
_1="-D WITH_CODEC_FFMPEG=ON"
_2="-D FFMPEG_LIBRARIES='avformat;avcodec;avutil;avdevice;swscale;swresample;lzma;rt;`print_info_ffmpeglink`'"
PRINT " $_1"
PRINT " $_2"
_buildargs="$_buildargs $_1 $_2"
_buildargs="$_buildargs $_1"
if [ -d $INST/ffmpeg ]; then
_1="-D FFMPEG=$INST/ffmpeg"
_1="-D FFMPEG_ROOT_DIR=$INST/ffmpeg"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi

View File

@@ -1,64 +1,39 @@
@echo off
if NOT "%1" == "" (
if "%1" == "2013" (
echo "Building for VS2013"
set VSVER=12.0
set VSVER_SHORT=12
set BuildDir=VS12
goto par2
)
if "%1" == "2015" (
echo "Building for VS2015"
set VSVER=14.0
set VSVER_SHORT=14
set BuildDir=VS14
goto par2
)
if "%1" == "2017" (
echo "Building for VS2017"
set VSVER=15.0
set VSVER_SHORT=15
set BuildDir=VS15
goto par2
)
if "%1" == "2019" (
echo "Building for VS2019"
set VSVER=15.0
set VSVER_SHORT=15
set BuildDir=VS15
goto par2
)
)
:usage
Echo Usage build_deps 2013/2015/2017 x64/x86
Echo Usage build_deps 2017/2019 x64
goto exit
:par2
if NOT "%2" == "" (
if "%2" == "x86" (
echo "Building for x86"
set HARVESTROOT=Windows_vc
set ARCH=86
if "%1" == "2013" (
set CMAKE_BUILDER=Visual Studio 12 2013
)
if "%1" == "2015" (
set CMAKE_BUILDER=Visual Studio 14 2015
)
if "%1" == "2017" (
set CMAKE_BUILDER=Visual Studio 15 2017
)
goto start
)
if "%2" == "x64" (
echo "Building for x64"
set HARVESTROOT=Win64_vc
set ARCH=64
if "%1" == "2013" (
set CMAKE_BUILDER=Visual Studio 12 2013 Win64
)
if "%1" == "2015" (
set CMAKE_BUILDER=Visual Studio 14 2015 Win64
if "%1" == "2019" (
set CMAKE_BUILDER=Visual Studio 16 2019
set CMAKE_BUILD_ARCH=-A x64
)
if "%1" == "2017" (
set CMAKE_BUILDER=Visual Studio 15 2017 Win64
set CMAKE_BUILD_ARCH=
)
goto start
)
)
@@ -120,7 +95,7 @@ set path=%BUILD_DIR%\downloads\mingw\mingw64\msys\1.0\bin\;%BUILD_DIR%\downloads
mkdir %STAGING%\%BuildDir%%ARCH%R
cd %Staging%\%BuildDir%%ARCH%R
echo %DATE% %TIME% : Start > %StatusFile%
cmake -G "%CMAKE_BUILDER%" -Thost=x64 %SOURCE_DIR% -DPACKAGE_DIR=%BUILD_DIR%/packages -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DBUILD_MODE=Release -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/
cmake -G "%CMAKE_BUILDER%" %CMAKE_BUILD_ARCH% -Thost=x64 %SOURCE_DIR% -DPACKAGE_DIR=%BUILD_DIR%/packages -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DBUILD_MODE=Release -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/
echo %DATE% %TIME% : Release Configuration done >> %StatusFile%
if "%dobuild%" == "1" (
msbuild /m "ll.vcxproj" /p:Configuration=Release /fl /flp:logfile=BlenderDeps_llvm.log;Verbosity=normal
@@ -133,7 +108,7 @@ if "%NODEBUG%" == "1" goto exit
cd %BUILD_DIR%
mkdir %STAGING%\%BuildDir%%ARCH%D
cd %Staging%\%BuildDir%%ARCH%D
cmake -G "%CMAKE_BUILDER%" -Thost=x64 %SOURCE_DIR% -DPACKAGE_DIR=%BUILD_DIR%/packages -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DCMAKE_BUILD_TYPE=Debug -DBUILD_MODE=Debug -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/ %CMAKE_DEBUG_OPTIONS%
cmake -G "%CMAKE_BUILDER%" %CMAKE_BUILD_ARCH% -Thost=x64 %SOURCE_DIR% -DPACKAGE_DIR=%BUILD_DIR%/packages -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DCMAKE_BUILD_TYPE=Debug -DBUILD_MODE=Debug -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/ %CMAKE_DEBUG_OPTIONS%
echo %DATE% %TIME% : Debug Configuration done >> %StatusFile%
if "%dobuild%" == "1" (
msbuild /m "ll.vcxproj" /p:Configuration=Debug /fl /flp:logfile=BlenderDeps_llvm.log;;Verbosity=normal

View File

@@ -0,0 +1,83 @@
# - Find Brotli library (compression for freetype/woff2).
# This module defines
# BROTLI_INCLUDE_DIRS, where to find Brotli headers, Set when
# BROTLI_INCLUDE_DIR is found.
# BROTLI_LIBRARIES, libraries to link against to use Brotli.
# BROTLI_ROOT_DIR, The base directory to search for Brotli.
# This can also be an environment variable.
# BROTLI_FOUND, If false, do not try to use Brotli.
#
#=============================================================================
# Copyright 2022 Blender Foundation.
#
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If BROTLI_ROOT_DIR was defined in the environment, use it.
IF(NOT BROTLI_ROOT_DIR AND NOT $ENV{BROTLI_ROOT_DIR} STREQUAL "")
SET(BROTLI_ROOT_DIR $ENV{BROTLI_ROOT_DIR})
ENDIF()
SET(_BROTLI_SEARCH_DIRS
${BROTLI_ROOT_DIR}
)
FIND_PATH(BROTLI_INCLUDE_DIR
NAMES
brotli/decode.h
HINTS
${_BROTLI_SEARCH_DIRS}
PATH_SUFFIXES
include
DOC "Brotli header files"
)
FIND_LIBRARY(BROTLI_LIBRARY_COMMON
NAMES
# Some builds use a special `-static` postfix in their static libraries names.
brotlicommon-static
brotlicommon
HINTS
${_BROTLI_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib lib/static
DOC "Brotli static common library"
)
FIND_LIBRARY(BROTLI_LIBRARY_DEC
NAMES
# Some builds use a special `-static` postfix in their static libraries names.
brotlidec-static
brotlidec
HINTS
${_BROTLI_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib lib/static
DOC "Brotli static decode library"
)
IF(${BROTLI_LIBRARY_COMMON_NOTFOUND} or ${BROTLI_LIBRARY_DEC_NOTFOUND})
set(BROTLI_FOUND FALSE)
ELSE()
# handle the QUIETLY and REQUIRED arguments and set BROTLI_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Brotli DEFAULT_MSG BROTLI_LIBRARY_COMMON BROTLI_LIBRARY_DEC BROTLI_INCLUDE_DIR)
IF(BROTLI_FOUND)
get_filename_component(BROTLI_LIBRARY_DIR ${BROTLI_LIBRARY_COMMON} DIRECTORY)
SET(BROTLI_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR})
SET(BROTLI_LIBRARIES ${BROTLI_LIBRARY_DEC} ${BROTLI_LIBRARY_COMMON})
ENDIF()
ENDIF()
MARK_AS_ADVANCED(
BROTLI_INCLUDE_DIR
BROTLI_LIBRARY_COMMON
BROTLI_LIBRARY_DEC
BROTLI_LIBRARY_DIR
)
UNSET(_BROTLI_SEARCH_DIRS)

View File

@@ -33,6 +33,8 @@ if(NOT FFMPEG_FIND_COMPONENTS)
avfilter
avformat
avutil
swscale
swresample
)
endif()
@@ -50,9 +52,9 @@ foreach(_component ${FFMPEG_FIND_COMPONENTS})
string(TOUPPER ${_component} _upper_COMPONENT)
find_library(FFMPEG_${_upper_COMPONENT}_LIBRARY
NAMES
${_upper_COMPONENT}
${_component}
HINTS
${LIBDIR}/ffmpeg
${_ffmpeg_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)

View File

@@ -34,7 +34,7 @@ IF(NOT PYTHON_ROOT_DIR AND NOT $ENV{PYTHON_ROOT_DIR} STREQUAL "")
SET(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR})
ENDIF()
SET(PYTHON_VERSION 3.9 CACHE STRING "Python Version (major and minor only)")
SET(PYTHON_VERSION 3.10 CACHE STRING "Python Version (major and minor only)")
MARK_AS_ADVANCED(PYTHON_VERSION)

View File

@@ -1,11 +1,4 @@
# ---
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.apache.org/licenses/LICENSE-2.0
# ---
# by Campbell Barton
# Apache License, Version 2.0
"""
Invocation:

View File

@@ -488,7 +488,6 @@ function(blender_add_test_executable
include_directories(${includes})
include_directories(${includes_sys})
setup_libdirs()
BLENDER_SRC_GTEST_EX(
NAME ${name}
@@ -525,83 +524,6 @@ function(setup_heavy_lib_pool)
endif()
endfunction()
function(SETUP_LIBDIRS)
# NOTE: For all new libraries, use absolute library paths.
# This should eventually be phased out.
# APPLE platform uses full paths for linking libraries, and avoids link_directories.
if(NOT MSVC AND NOT APPLE)
link_directories(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH})
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
link_directories(${PYTHON_LIBPATH})
endif()
if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
link_directories(${SDL_LIBPATH})
endif()
if(WITH_CODEC_FFMPEG)
link_directories(${FFMPEG_LIBPATH})
endif()
if(WITH_IMAGE_OPENEXR)
link_directories(${OPENEXR_LIBPATH})
endif()
if(WITH_IMAGE_TIFF)
link_directories(${TIFF_LIBPATH})
endif()
if(WITH_BOOST)
link_directories(${BOOST_LIBPATH})
endif()
if(WITH_OPENIMAGEIO)
link_directories(${OPENIMAGEIO_LIBPATH})
endif()
if(WITH_OPENIMAGEDENOISE)
link_directories(${OPENIMAGEDENOISE_LIBPATH})
endif()
if(WITH_OPENCOLORIO)
link_directories(${OPENCOLORIO_LIBPATH})
endif()
if(WITH_OPENVDB)
link_directories(${OPENVDB_LIBPATH})
endif()
if(WITH_OPENAL)
link_directories(${OPENAL_LIBPATH})
endif()
if(WITH_JACK AND NOT WITH_JACK_DYNLOAD)
link_directories(${JACK_LIBPATH})
endif()
if(WITH_PULSEAUDIO AND NOT WITH_PULSEAUDIO_DYNLOAD)
link_directories(${LIBPULSE_LIBPATH})
endif()
if(WITH_CODEC_SNDFILE)
link_directories(${LIBSNDFILE_LIBPATH})
endif()
if(WITH_FFTW3)
link_directories(${FFTW3_LIBPATH})
endif()
if(WITH_OPENCOLLADA)
link_directories(${OPENCOLLADA_LIBPATH})
# # Never set
# link_directories(${PCRE_LIBPATH})
# link_directories(${EXPAT_LIBPATH})
endif()
if(WITH_LLVM)
link_directories(${LLVM_LIBPATH})
endif()
if(WITH_ALEMBIC)
link_directories(${ALEMBIC_LIBPATH})
endif()
if(WITH_GMP)
link_directories(${GMP_LIBPATH})
endif()
if(WIN32 AND NOT UNIX)
link_directories(${PTHREADS_LIBPATH})
endif()
endif()
endfunction()
# Platform specific linker flags for targets.
function(setup_platform_linker_flags
target)
@@ -1275,21 +1197,21 @@ endfunction()
macro(openmp_delayload
projectname
)
if(MSVC)
if(WITH_OPENMP)
if(MSVC_CLANG)
set(OPENMP_DLL_NAME "libomp")
elseif(MSVC_VERSION EQUAL 1800)
set(OPENMP_DLL_NAME "vcomp120")
else()
set(OPENMP_DLL_NAME "vcomp140")
endif()
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG " /DELAYLOAD:${OPENMP_DLL_NAME}d.dll delayimp.lib")
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
if(MSVC)
if(WITH_OPENMP)
if(MSVC_CLANG)
set(OPENMP_DLL_NAME "libomp")
elseif(MSVC_VERSION EQUAL 1800)
set(OPENMP_DLL_NAME "vcomp120")
else()
set(OPENMP_DLL_NAME "vcomp140")
endif()
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG " /DELAYLOAD:${OPENMP_DLL_NAME}d.dll delayimp.lib")
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
endif()
endif()
endmacro()
macro(set_and_warn_dependency

View File

@@ -128,25 +128,20 @@ if(WITH_CODEC_SNDFILE)
endif()
if(WITH_PYTHON)
# we use precompiled libraries for py 3.9 and up by default
set(PYTHON_VERSION 3.9)
# Use precompiled libraries by default.
set(PYTHON_VERSION 3.10)
if(NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
# normally cached but not since we include them with blender
# Normally cached but not since we include them with blender.
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}")
set(PYTHON_LIBRARY ${LIBDIR}/python/lib/libpython${PYTHON_VERSION}.a)
set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
# set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
else()
# module must be compiled against Python framework
# Module must be compiled against Python framework.
set(_py_framework "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}")
set(PYTHON_INCLUDE_DIR "${_py_framework}/include/python${PYTHON_VERSION}")
set(PYTHON_EXECUTABLE "${_py_framework}/bin/python${PYTHON_VERSION}")
set(PYTHON_LIBPATH "${_py_framework}/lib/python${PYTHON_VERSION}")
# set(PYTHON_LIBRARY python${PYTHON_VERSION})
# set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python") # won't build with this enabled
unset(_py_framework)
endif()
@@ -166,13 +161,18 @@ if(WITH_FFTW3)
find_package(Fftw3)
endif()
# FreeType compiled with Brotli compression for woff2.
find_package(Freetype REQUIRED)
list(APPEND FREETYPE_LIBRARIES
${LIBDIR}/brotli/lib/libbrotlicommon-static.a
${LIBDIR}/brotli/lib/libbrotlidec-static.a)
if(WITH_IMAGE_OPENEXR)
find_package(OpenEXR)
endif()
if(WITH_CODEC_FFMPEG)
set(FFMPEG_ROOT_DIR ${LIBDIR}/ffmpeg)
set(FFMPEG_FIND_COMPONENTS
avcodec avdevice avformat avutil
mp3lame ogg opus swresample swscale
@@ -479,8 +479,11 @@ string(APPEND PLATFORM_LINKFLAGS " -stdlib=libc++")
# Suppress ranlib "has no symbols" warnings (workaround for T48250)
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
# llvm-ranlib doesn't support this flag. Xcode's libtool does.
if(NOT ${CMAKE_RANLIB} MATCHES ".*llvm-ranlib$")
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
endif()
if(WITH_COMPILER_CCACHE)
if(NOT CMAKE_GENERATOR STREQUAL "Xcode")
@@ -507,3 +510,6 @@ list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
set(CMAKE_SKIP_INSTALL_RPATH FALSE)
list(APPEND CMAKE_INSTALL_RPATH "@loader_path/../Resources/${BLENDER_VERSION}/lib")
# Same as `CFBundleIdentifier` in Info.plist.
set(CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "org.blenderfoundation.blender")

View File

@@ -48,6 +48,9 @@ if(NOT DEFINED LIBDIR)
unset(LIBDIR_CENTOS7_ABI)
endif()
# Support restoring this value once pre-compiled libraries have been handled.
set(WITH_STATIC_LIBS_INIT ${WITH_STATIC_LIBS})
if(EXISTS ${LIBDIR})
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
@@ -100,7 +103,22 @@ find_package_wrapper(JPEG REQUIRED)
find_package_wrapper(PNG REQUIRED)
find_package_wrapper(ZLIB REQUIRED)
find_package_wrapper(Zstd REQUIRED)
find_package_wrapper(Freetype REQUIRED)
if(NOT WITH_SYSTEM_FREETYPE)
# FreeType compiled with Brotli compression for woff2.
find_package_wrapper(Freetype REQUIRED)
if(EXISTS ${LIBDIR})
find_package_wrapper(Brotli REQUIRED)
# NOTE: This is done on WIN32 & APPLE but fails on some Linux systems.
# See: https://devtalk.blender.org/t/22536
# So `BROTLI_LIBRARIES` need to be added directly after `FREETYPE_LIBRARIES`.
#
# list(APPEND FREETYPE_LIBRARIES
# ${BROTLI_LIBRARIES}
# )
endif()
endif()
if(WITH_PYTHON)
# No way to set py35, remove for now.
@@ -178,26 +196,30 @@ endif()
if(WITH_CODEC_FFMPEG)
if(EXISTS ${LIBDIR})
# For precompiled lib directory, all ffmpeg dependencies are in the same folder
file(GLOB ffmpeg_libs ${LIBDIR}/ffmpeg/lib/*.a ${LIBDIR}/sndfile/lib/*.a)
set(FFMPEG ${LIBDIR}/ffmpeg CACHE PATH "FFMPEG Directory")
set(FFMPEG_LIBRARIES ${ffmpeg_libs} ${ffmpeg_libs} CACHE STRING "FFMPEG Libraries")
else()
set(FFMPEG /usr CACHE PATH "FFMPEG Directory")
set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
set(FFMPEG_ROOT_DIR ${LIBDIR}/ffmpeg)
# Override FFMPEG components to also include static library dependencies
# included with precompiled libraries, and to ensure correct link order.
set(FFMPEG_FIND_COMPONENTS
avformat avcodec avdevice avutil swresample swscale
sndfile
FLAC
mp3lame
opus
theora theoradec theoraenc
vorbis vorbisenc vorbisfile ogg
vpx
x264
xvidcore)
elseif(FFMPEG)
# Old cache variable used for root dir, convert to new standard.
set(FFMPEG_ROOT_DIR ${FFMPEG})
endif()
find_package(FFmpeg)
mark_as_advanced(FFMPEG)
# lame, but until we have proper find module for ffmpeg
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
if(EXISTS "${FFMPEG}/include/ffmpeg/")
list(APPEND FFMPEG_INCLUDE_DIRS "${FFMPEG}/include/ffmpeg")
if(NOT FFMPEG_FOUND)
set(WITH_CODEC_FFMPEG OFF)
message(STATUS "FFmpeg not found, disabling it")
endif()
# end lameness
mark_as_advanced(FFMPEG_LIBRARIES)
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
endif()
if(WITH_FFTW3)
@@ -532,6 +554,21 @@ add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
#
# Keep last, so indirectly linked libraries don't override our own pre-compiled libs.
if(EXISTS ${LIBDIR})
# Clear the prefix path as it causes the `LIBDIR` to override system locations.
unset(CMAKE_PREFIX_PATH)
# Since the pre-compiled `LIBDIR` directories have been handled, don't prefer static libraries.
set(WITH_STATIC_LIBS ${WITH_STATIC_LIBS_INIT})
endif()
if(WITH_SYSTEM_FREETYPE)
find_package_wrapper(Freetype)
if(NOT FREETYPE_FOUND)
message(FATAL_ERROR "Failed finding system FreeType version!")
endif()
endif()
if(WITH_LZO AND WITH_SYSTEM_LZO)
find_package_wrapper(LZO)
if(NOT LZO_FOUND)
@@ -644,6 +681,9 @@ endif()
# ----------------------------------------------------------------------------
# Compilers
# Only set the linker once.
set(_IS_LINKER_DEFAULT ON)
# GNU Compiler
if(CMAKE_COMPILER_IS_GNUCC)
# ffp-contract=off:
@@ -662,26 +702,89 @@ if(CMAKE_COMPILER_IS_GNUCC)
string(PREPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO "${GCC_EXTRA_FLAGS_RELEASE} ")
unset(GCC_EXTRA_FLAGS_RELEASE)
if(WITH_LINKER_GOLD)
# NOTE(@campbellbarton): Eventually mold will be able to use `-fuse-ld=mold`,
# however at the moment this only works for GCC 12.1+ (unreleased at time of writing).
# So a workaround is used here "-B" which points to another path to find system commands
# such as `ld`.
if(WITH_LINKER_MOLD AND _IS_LINKER_DEFAULT)
find_program(MOLD_BIN "mold")
mark_as_advanced(MOLD_BIN)
if(NOT MOLD_BIN)
message(STATUS "The \"mold\" binary could not be found, using system linker.")
set(WITH_LINKER_MOLD OFF)
else()
# By default mold installs the binary to:
# - `{PREFIX}/bin/mold` as well as a symbolic-link in...
# - `{PREFIX}/lib/mold/ld`.
# (where `PREFIX` is typically `/usr/`).
#
# This block of code finds `{PREFIX}/lib/mold` from the `mold` binary.
# Other methods of searching for the path could also be made to work,
# we could even make our own directory and symbolic-link, however it's more
# convenient to use the one provided by mold.
#
# Use the binary path to "mold", to find the common prefix which contains "lib/mold".
# The parent directory: e.g. `/usr/bin/mold` -> `/usr/bin/`.
get_filename_component(MOLD_PREFIX "${MOLD_BIN}" DIRECTORY)
# The common prefix path: e.g. `/usr/bin/` -> `/usr/` to use as a hint.
get_filename_component(MOLD_PREFIX "${MOLD_PREFIX}" DIRECTORY)
# Find `{PREFIX}/lib/mold/ld`, store the directory component (without the `ld`).
# Then pass `-B {PREFIX}/lib/mold` to GCC so the `ld` located there overrides the default.
find_path(
MOLD_BIN_DIR "ld"
HINTS "${MOLD_PREFIX}"
# The default path is `libexec`, Arch Linux for e.g.
# replaces this with `lib` so check both.
PATH_SUFFIXES "libexec/mold" "lib/mold" "lib64/mold"
NO_DEFAULT_PATH
NO_CACHE
)
if(NOT MOLD_BIN_DIR)
message(STATUS
"The mold linker could not find the directory containing the linker command "
"(typically "
"\"${MOLD_PREFIX}/libexec/mold/ld\") or "
"\"${MOLD_PREFIX}/lib/mold/ld\") using system linker.")
set(WITH_LINKER_MOLD OFF)
endif()
unset(MOLD_PREFIX)
endif()
if(WITH_LINKER_MOLD)
# GCC will search for `ld` in this directory first.
string(APPEND CMAKE_EXE_LINKER_FLAGS " -B \"${MOLD_BIN_DIR}\"")
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -B \"${MOLD_BIN_DIR}\"")
string(APPEND CMAKE_MODULE_LINKER_FLAGS " -B \"${MOLD_BIN_DIR}\"")
set(_IS_LINKER_DEFAULT OFF)
endif()
unset(MOLD_BIN)
unset(MOLD_BIN_DIR)
endif()
if(WITH_LINKER_GOLD AND _IS_LINKER_DEFAULT)
execute_process(
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if("${LD_VERSION}" MATCHES "GNU gold")
string(APPEND CMAKE_C_FLAGS " -fuse-ld=gold")
string(APPEND CMAKE_CXX_FLAGS " -fuse-ld=gold")
string(APPEND CMAKE_EXE_LINKER_FLAGS " -fuse-ld=gold")
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -fuse-ld=gold")
string(APPEND CMAKE_MODULE_LINKER_FLAGS " -fuse-ld=gold")
set(_IS_LINKER_DEFAULT OFF)
else()
message(STATUS "GNU gold linker isn't available, using the default system linker.")
endif()
unset(LD_VERSION)
endif()
if(WITH_LINKER_LLD)
if(WITH_LINKER_LLD AND _IS_LINKER_DEFAULT)
execute_process(
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=lld -Wl,--version
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if("${LD_VERSION}" MATCHES "LLD")
string(APPEND CMAKE_C_FLAGS " -fuse-ld=lld")
string(APPEND CMAKE_CXX_FLAGS " -fuse-ld=lld")
string(APPEND CMAKE_EXE_LINKER_FLAGS " -fuse-ld=lld")
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -fuse-ld=lld")
string(APPEND CMAKE_MODULE_LINKER_FLAGS " -fuse-ld=lld")
set(_IS_LINKER_DEFAULT OFF)
else()
message(STATUS "LLD linker isn't available, using the default system linker.")
endif()
@@ -691,6 +794,28 @@ if(CMAKE_COMPILER_IS_GNUCC)
# CLang is the same as GCC for now.
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
if(WITH_LINKER_MOLD AND _IS_LINKER_DEFAULT)
find_program(MOLD_BIN "mold")
mark_as_advanced(MOLD_BIN)
if(NOT MOLD_BIN)
message(STATUS "The \"mold\" binary could not be found, using system linker.")
set(WITH_LINKER_MOLD OFF)
else()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0)
string(APPEND CMAKE_EXE_LINKER_FLAGS " --ld-path=\"${MOLD_BIN}\"")
string(APPEND CMAKE_SHARED_LINKER_FLAGS " --ld-path=\"${MOLD_BIN}\"")
string(APPEND CMAKE_MODULE_LINKER_FLAGS " --ld-path=\"${MOLD_BIN}\"")
else()
string(APPEND CMAKE_EXE_LINKER_FLAGS " -fuse-ld=\"${MOLD_BIN}\"")
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -fuse-ld=\"${MOLD_BIN}\"")
string(APPEND CMAKE_MODULE_LINKER_FLAGS " -fuse-ld=\"${MOLD_BIN}\"")
endif()
set(_IS_LINKER_DEFAULT OFF)
endif()
unset(MOLD_BIN)
endif()
# Intel C++ Compiler
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
# think these next two are broken
@@ -714,6 +839,8 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
string(APPEND PLATFORM_LINKFLAGS " -static-intel")
endif()
unset(_IS_LINKER_DEFAULT)
# Avoid conflicts with Mesa llvmpipe, Luxrender, and other plug-ins that may
# use the same libraries as Blender with a different version or build options.
set(PLATFORM_LINKFLAGS

View File

@@ -55,6 +55,10 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
message(WARNING "stripped pdb not supported with clang, disabling..")
set(WITH_WINDOWS_STRIPPED_PDB OFF)
endif()
else()
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.28.29921) # MSVC 2019 16.9.16
message(FATAL_ERROR "Compiler is unsupported, MSVC 2019 16.9.16 or newer is required for building blender.")
endif()
endif()
if(NOT WITH_PYTHON_MODULE)
@@ -265,12 +269,6 @@ if(NOT DEFINED LIBDIR)
elseif(MSVC_VERSION GREATER 1919)
message(STATUS "Visual Studio 2019 detected.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
elseif(MSVC_VERSION GREATER 1909)
message(STATUS "Visual Studio 2017 detected.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
elseif(MSVC_VERSION EQUAL 1900)
message(STATUS "Visual Studio 2015 detected.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
endif()
else()
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
@@ -347,7 +345,11 @@ set(FREETYPE_INCLUDE_DIRS
${LIBDIR}/freetype/include
${LIBDIR}/freetype/include/freetype2
)
set(FREETYPE_LIBRARY ${LIBDIR}/freetype/lib/freetype2ST.lib)
set(FREETYPE_LIBRARIES
${LIBDIR}/freetype/lib/freetype2ST.lib
${LIBDIR}/brotli/lib/brotlidec-static.lib
${LIBDIR}/brotli/lib/brotlicommon-static.lib
)
windows_find_package(freetype REQUIRED)
if(WITH_FFTW3)
@@ -461,7 +463,7 @@ if(WITH_JACK)
endif()
if(WITH_PYTHON)
set(PYTHON_VERSION 3.9) # CACHE STRING)
set(PYTHON_VERSION 3.10) # CACHE STRING)
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
set(PYTHON_LIBRARY ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/libs/python${_PYTHON_VERSION_NO_DOTS}.lib)

View File

@@ -3,9 +3,6 @@ echo No explicit msvc version requested, autodetecting version.
call "%~dp0\detect_msvc2019.cmd"
if %ERRORLEVEL% EQU 0 goto DetectionComplete
call "%~dp0\detect_msvc2017.cmd"
if %ERRORLEVEL% EQU 0 goto DetectionComplete
call "%~dp0\detect_msvc2022.cmd"
if %ERRORLEVEL% EQU 0 goto DetectionComplete

View File

@@ -1,4 +1,3 @@
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc15
if "%BUILD_VS_YEAR%"=="2019" set BUILD_VS_LIBDIRPOST=vc15
if "%BUILD_VS_YEAR%"=="2022" set BUILD_VS_LIBDIRPOST=vc15

View File

@@ -19,12 +19,6 @@ if "%WITH_PYDEBUG%"=="1" (
set PYDEBUG_CMAKE_ARGS=-DWINDOWS_PYTHON_DEBUG=On
)
if "%BUILD_VS_YEAR%"=="2017" (
set BUILD_GENERATOR_POST=%WINDOWS_ARCH%
) else (
set BUILD_PLATFORM_SELECT=-A %MSBUILD_PLATFORM%
)
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%BUILD_GENERATOR_POST%" %BUILD_PLATFORM_SELECT% %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS% %PYDEBUG_CMAKE_ARGS%
if NOT EXIST %BUILD_DIR%\nul (

View File

@@ -37,15 +37,9 @@ set LLVM_DIR=
:DetectionComplete
set CC=%LLVM_DIR%\bin\clang-cl
set CXX=%LLVM_DIR%\bin\clang-cl
if "%BUILD_VS_YEAR%" == "2019" (
rem build and tested against 2019 16.2
set CFLAGS=-m64 -fmsc-version=1922
set CXXFLAGS=-m64 -fmsc-version=1922
) else (
rem build and tested against 2017 15.7
set CFLAGS=-m64 -fmsc-version=1914
set CXXFLAGS=-m64 -fmsc-version=1914
)
rem build and tested against 2019 16.2
set CFLAGS=-m64 -fmsc-version=1922
set CXXFLAGS=-m64 -fmsc-version=1922
)
if "%WITH_ASAN%"=="1" (

View File

@@ -1,3 +0,0 @@
set BUILD_VS_VER=15
set BUILD_VS_YEAR=2017
call "%~dp0\detect_msvc_vswhere.cmd"

View File

@@ -3,7 +3,32 @@ for %%X in (svn.exe) do (set SVN=%%~$PATH:X)
for %%X in (cmake.exe) do (set CMAKE=%%~$PATH:X)
for %%X in (ctest.exe) do (set CTEST=%%~$PATH:X)
for %%X in (git.exe) do (set GIT=%%~$PATH:X)
REM For python, default on 39 but if that does not exist also check
REM the 310,311 and 312 folders to see if those are there, it checks
REM this far ahead to ensure good lib folder compatiblity in the future.
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
if EXIST %PYTHON% (
goto detect_python_done
)
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\310\bin\python.exe
if EXIST %PYTHON% (
goto detect_python_done
)
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\311\bin\python.exe
if EXIST %PYTHON% (
goto detect_python_done
)
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\312\bin\python.exe
if EXIST %PYTHON% (
goto detect_python_done
)
if NOT EXIST %PYTHON% (
echo Warning: Python not found, there is likely an issue with the library folder
set PYTHON=""
)
:detect_python_done
if NOT "%verbose%" == "" (
echo svn : "%SVN%"
echo cmake : "%CMAKE%"
@@ -11,7 +36,3 @@ if NOT "%verbose%" == "" (
echo git : "%GIT%"
echo python : "%PYTHON%"
)
if "%CMAKE%" == "" (
echo Cmake not found in path, required for building, exiting...
exit /b 1
)

View File

@@ -9,17 +9,11 @@ exit /b 1
:detect_done
echo found clang-format in %CF_PATH%
if EXIST %PYTHON% (
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
goto detect_python_done
if NOT EXIST %PYTHON% (
echo python not found, required for this operation
exit /b 1
)
echo python not found in lib folder
exit /b 1
:detect_python_done
echo found python (%PYTHON%)
set FORMAT_PATHS=%BLENDER_DIR%\source\tools\utils_maintenance\clang_format_paths.py
REM The formatting script expects clang-format to be in the current PATH.

View File

@@ -1,18 +1,8 @@
if EXIST "%PYTHON%" (
goto detect_python_done
if NOT EXIST %PYTHON% (
echo python not found, required for this operation
exit /b 1
)
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
if EXIST %PYTHON% (
goto detect_python_done
)
echo python not found at %PYTHON%
exit /b 1
:detect_python_done
echo found python (%PYTHON%)
call "%~dp0\find_inkscape.cmd"
if EXIST "%INKSCAPE_BIN%" (

View File

@@ -1,18 +1,8 @@
if EXIST %PYTHON% (
goto detect_python_done
if NOT EXIST %PYTHON% (
echo python not found, required for this operation
exit /b 1
)
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
if EXIST %PYTHON% (
goto detect_python_done
)
echo python not found at %PYTHON%
exit /b 1
:detect_python_done
echo found python (%PYTHON%)
call "%~dp0\find_blender.cmd"
if EXIST "%BLENDER_BIN%" (

View File

@@ -50,14 +50,6 @@ if NOT "%1" == "" (
goto ERR
) else if "%1" == "x64" (
set BUILD_ARCH=x64
) else if "%1" == "2017" (
set BUILD_VS_YEAR=2017
) else if "%1" == "2017pre" (
set BUILD_VS_YEAR=2017
set VSWHERE_ARGS=-prerelease
) else if "%1" == "2017b" (
set BUILD_VS_YEAR=2017
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
) else if "%1" == "2019" (
set BUILD_VS_YEAR=2019
) else if "%1" == "2019pre" (

View File

@@ -24,12 +24,12 @@ echo - nobuildinfo ^(disable buildinfo^)
echo - debug ^(Build an unoptimized debuggable build^)
echo - packagename [newname] ^(override default cpack package name^)
echo - builddir [newdir] ^(override default build folder^)
echo - 2017 ^(build with visual studio 2017^)
echo - 2017pre ^(build with visual studio 2017 pre-release^)
echo - 2017b ^(build with visual studio 2017 Build Tools^)
echo - 2019 ^(build with visual studio 2019^)
echo - 2019pre ^(build with visual studio 2019 pre-release^)
echo - 2019b ^(build with visual studio 2019 Build Tools^)
echo - 2022 ^(build with visual studio 2022^)
echo - 2022pre ^(build with visual studio 2022 pre-release^)
echo - 2022b ^(build with visual studio 2022 Build Tools^)
echo.
echo Documentation Targets ^(Not associated with building^)

View File

@@ -1,4 +1,3 @@
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc15
if "%BUILD_VS_YEAR%"=="2019" set BUILD_VS_LIBDIRPOST=vc15
if "%BUILD_VS_YEAR%"=="2022" set BUILD_VS_LIBDIRPOST=vc15

View File

@@ -1,10 +1,7 @@
if EXIST %PYTHON% (
goto detect_python_done
if NOT EXIST %PYTHON% (
echo python not found, required for this operation
exit /b 1
)
echo python not found in lib folder
exit /b 1
:detect_python_done
REM Use -B to avoid writing __pycache__ in lib directory and causing update conflicts.

View File

@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = V3.1
PROJECT_NUMBER = V3.2
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@@ -8,27 +8,42 @@ def set_pose_matrices(obj, matrix_map):
"Assign pose space matrices of all bones at once, ignoring constraints."
def rec(pbone, parent_matrix):
matrix = matrix_map[pbone.name]
if pbone.name in matrix_map:
matrix = matrix_map[pbone.name]
## Instead of:
# pbone.matrix = matrix
# bpy.context.view_layer.update()
## Instead of:
# pbone.matrix = matrix
# bpy.context.view_layer.update()
# Compute and assign local matrix, using the new parent matrix
if pbone.parent:
pbone.matrix_basis = pbone.bone.convert_local_to_pose(
matrix,
pbone.bone.matrix_local,
parent_matrix=parent_matrix,
parent_matrix_local=pbone.parent.bone.matrix_local,
invert=True
)
# Compute and assign local matrix, using the new parent matrix
if pbone.parent:
pbone.matrix_basis = pbone.bone.convert_local_to_pose(
matrix,
pbone.bone.matrix_local,
parent_matrix=parent_matrix,
parent_matrix_local=pbone.parent.bone.matrix_local,
invert=True
)
else:
pbone.matrix_basis = pbone.bone.convert_local_to_pose(
matrix,
pbone.bone.matrix_local,
invert=True
)
else:
pbone.matrix_basis = pbone.bone.convert_local_to_pose(
matrix,
pbone.bone.matrix_local,
invert=True
)
# Compute the updated pose matrix from local and new parent matrix
if pbone.parent:
matrix = pbone.bone.convert_local_to_pose(
pbone.matrix_basis,
pbone.bone.matrix_local,
parent_matrix=parent_matrix,
parent_matrix_local=pbone.parent.bone.matrix_local,
)
else:
matrix = pbone.bone.convert_local_to_pose(
pbone.matrix_basis,
pbone.bone.matrix_local,
)
# Recursively process children, passing the new matrix through
for child in pbone.children:

View File

@@ -22,7 +22,7 @@ Data Access
===========
The most common case for using the reference API is to find out how to access data in the blend-file.
Before going any further its best to be aware of ID data-blocks in Blender since you will often find properties
Before going any further it's best to be aware of ID data-blocks in Blender since you will often find properties
relative to them.
@@ -55,9 +55,9 @@ Start by collecting the information where the data is located.
First find this setting in the interface ``Properties editor -> Object -> Transform -> Location``.
From the button context menu select *Online Python Reference*, this will link you to:
:class:`bpy.types.Object.location`.
Being an API reference, this link often gives little more information then the tooltip, though some of the pages
Being an API reference, this link often gives little more information than the tooltip, though some of the pages
include examples (normally at the top of the page).
But you now know that you have to use ``.location`` and that its an array of three floats.
But you now know that you have to use ``.location`` and that it's an array of three floats.
So the next step is to find out where to access objects, go down to the bottom of the page to the references section,
for objects there are many references, but one of the most common places to access objects is via the context.
@@ -154,7 +154,7 @@ The tooltip includes :class:`bpy.types.SubsurfModifier.levels` but you want the
Note that the text copied won't include the ``bpy.data.collection["name"].`` component since its assumed that
you won't be doing collection look-ups on every access and typically you'll want to use the context rather
then access each :class:`bpy.types.ID` instance by name.
than access each :class:`bpy.types.ID` instance by name.
Type in the ID path into a Python console :mod:`bpy.context.active_object`.
Include the trailing dot and don't execute the code, yet.
@@ -252,6 +252,6 @@ Each entry can be selected, then copied :kbd:`Ctrl-C`, usually to paste in the t
.. note::
Not all operators get registered for display,
zooming the view for example isn't so useful to repeat so its excluded from the output.
zooming the view for example isn't so useful to repeat so it's excluded from the output.
To display *every* operator that runs see :ref:`Show All Operators <info_show_all_operators>`.

View File

@@ -229,7 +229,7 @@ removing the last items first, which is faster (as explained above):
This example shows a fast way of removing items,
for use in cases where you can alter the list order without breaking the scripts functionality.
for use in cases where you can alter the list order without breaking the script's functionality.
This works by swapping two list items, so the item you remove is always last:
.. code-block:: python
@@ -278,7 +278,7 @@ Here are three ways of joining multiple strings into one string for writing.
This also applies to any area of your code that involves a lot of string joining:
String concatenation
This is the slowest option, do **not** use if you can avoid it, especially when writing data in a loop.
This is the slowest option, do **not** use this if you can avoid it, especially when writing data in a loop.
>>> file.write(str1 + " " + str2 + " " + str3 + "\n")
@@ -288,7 +288,7 @@ String formatting
>>> file.write("%s %s %s\n" % (str1, str2, str3))
String joining
Use to join a list of strings (the list may be temporary). In the following example, the strings are joined with
Use this to join a list of strings (the list may be temporary). In the following example, the strings are joined with
a space " " in between, other examples are "" or ", ".
>>> file.write(" ".join((str1, str2, str3, "\n")))

View File

@@ -12,7 +12,7 @@ that can be troublesome and avoid practices that are known to cause instability.
Using Operators
===============
Blender's operators are tools for users to access, that can access with Python too which is very useful.
Blender's operators are tools for users to access, that can be accessed with Python too which is very useful.
Still operators have limitations that can make them cumbersome to script.
The main limits are:
@@ -20,13 +20,13 @@ The main limits are:
- Can't pass data such as objects, meshes or materials to operate on (operators use the context instead).
- The return value from calling an operator is the success (if it finished or was canceled),
in some cases it would be more logical from an API perspective to return the result of the operation.
- Operators poll function can fail where an API function would raise an exception giving details on exactly why.
- Operators' poll function can fail where an API function would raise an exception giving details on exactly why.
Why does an operator's poll fail?
---------------------------------
When calling an operator gives an error like this:
When calling an operator it gives an error like this:
>>> bpy.ops.action.clean(threshold=0.001)
RuntimeError: Operator bpy.ops.action.clean.poll() failed, context is incorrect
@@ -49,9 +49,9 @@ you should be able to find the poll function with no knowledge of C.
.. note::
Blender does have the functionality for poll functions to describe why they fail,
but its currently not used much, if you're interested to help improve the API
but it's currently not used much, if you're interested to help improve the API
feel free to add calls to :class:`bpy.types.Operator.poll_message_set` (``CTX_wm_operator_poll_msg_set`` in C)
where its not obvious why poll fails, e.g:
where it's not obvious why poll fails, e.g:
>>> bpy.ops.gpencil.draw()
RuntimeError: Operator bpy.ops.gpencil.draw.poll() Failed to find Grease Pencil data to draw into
@@ -107,7 +107,7 @@ In this case you need to call :class:`bpy.types.ViewLayer.update` after modifyin
Now all dependent data (child objects, modifiers, drivers, etc.)
has been recalculated and is available to the script within active view layer.
have been recalculated and are available to the script within the active view layer.
Can I redraw during script execution?
@@ -116,13 +116,13 @@ Can I redraw during script execution?
The official answer to this is no, or... *"You don't want to do that"*.
To give some background on the topic:
While a script executes Blender waits for it to finish and is effectively locked until its done,
While a script executes, Blender waits for it to finish and is effectively locked until it's done;
while in this state Blender won't redraw or respond to user input.
Normally this is not such a problem because scripts distributed with Blender
tend not to run for an extended period of time,
nevertheless scripts *can* take a long time to complete and it would be nice to see progress in the viewport.
When tools lock Blender in a loop redraw are highly discouraged
Tools that lock Blender in a loop redraw are highly discouraged
since they conflict with Blender's ability to run multiple operators
at once and update different parts of the interface as the tool runs.
@@ -130,7 +130,7 @@ So the solution here is to write a **modal** operator, which is an operator that
See the modal operator template in the text editor.
Modal operators execute on user input or setup their own timers to run frequently,
they can handle the events or pass through to be handled by the keymap or other modal operators.
Examples of a modal operators are Transform, Painting, Fly Navigation and File Select.
Examples of modal operators are Transform, Painting, Fly Navigation and File Select.
Writing modal operators takes more effort than a simple ``for`` loop
that contains draw calls but is more flexible and integrates better with Blender's design.
@@ -240,7 +240,7 @@ Editing
Editing is where the three data types vary most.
- Polygons are very limited for editing,
changing materials and options like smooth works but for anything else
changing materials and options like smooth works, but for anything else
they are too inflexible and are only intended for storage.
- Tessfaces should not be used for editing geometry because doing so will cause existing n-gons to be tessellated.
- BMesh-faces are by far the best way to manipulate geometry.
@@ -256,7 +256,7 @@ the choice mostly depends on whether the target format supports n-gons or not.
- Tessfaces work well for exporting to formats which don't support n-gons,
in fact this is the only place where their use is encouraged.
- BMesh-Faces can work for exporting too but may not be necessary if polygons can be used
since using BMesh gives some overhead because its not the native storage format in Object-Mode.
since using BMesh gives some overhead because it's not the native storage format in Object-Mode.
Edit Bones, Pose Bones, Bone... Bones
@@ -348,7 +348,7 @@ Armature Mode Switching
While writing scripts that deal with armatures you may find you have to switch between modes,
when doing so take care when switching out of Edit-Mode not to keep references
to the edit bones or their head/tail vectors.
Further access to these will crash Blender so its important the script
Further access to these will crash Blender so it's important that the script
clearly separates sections of the code which operate in different modes.
This is mainly an issue with Edit-Mode since pose data can be manipulated without having to be in Pose-Mode,
@@ -386,11 +386,11 @@ Or with name assignment:
Data names may not match the assigned values if they exceed the maximum length, are already used or an empty string.
Its better practice not to reference objects by names at all,
It's better practice not to reference objects by names at all,
once created you can store the data in a list, dictionary, on a class, etc;
there is rarely a reason to have to keep searching for the same data by name.
If you do need to use name references, its best to use a dictionary to maintain
If you do need to use name references, it's best to use a dictionary to maintain
a mapping between the names of the imported assets and the newly created data,
this way you don't run this risk of referencing existing data from the blend-file, or worse modifying it.
@@ -414,11 +414,11 @@ Library Collisions
Blender keeps data names unique (:class:`bpy.types.ID.name`) so you can't name two objects,
meshes, scenes, etc., the same by accident.
However, when linking in library data from another blend-file naming collisions can occur,
so its best to avoid referencing data by name at all.
so it's best to avoid referencing data by name at all.
This can be tricky at times and not even Blender handles this correctly in some case
This can be tricky at times and not even Blender handles this correctly in some cases
(when selecting the modifier object for e.g. you can't select between multiple objects with the same name),
but its still good to try avoiding these problems in this area.
but it's still good to try avoiding these problems in this area.
If you need to select between local and library data, there is a feature in ``bpy.data`` members to allow for this.
.. code-block:: python
@@ -467,11 +467,11 @@ writing a script in ``latin1`` or ``iso-8859-15``.
See `PEP 263 <https://www.python.org/dev/peps/pep-0263/>`__.
However, this complicates matters for Blender's Python API because ``.blend`` files don't have an explicit encoding.
To avoid the problem for Python integration and script authors we have decided all strings in blend-files
To avoid the problem for Python integration and script authors we have decided that all strings in blend-files
**must** be ``UTF-8``, ``ASCII`` compatible.
This means assigning strings with different encodings to an object names for instance will raise an error.
This means assigning strings with different encodings to an object name, for instance, will raise an error.
Paths are an exception to this rule since the existence of non-UTF-8 paths on user's file system cannot be ignored.
Paths are an exception to this rule since the existence of non-UTF-8 paths on the user's file system cannot be ignored.
This means seemingly harmless expressions can raise errors, e.g:
>>> print(bpy.data.filepath)
@@ -505,7 +505,7 @@ to keep it short about encoding problems -- here are some suggestions:
.. note::
Sometimes it's preferable to avoid string encoding issues by using bytes instead of Python strings,
when reading some input its less trouble to read it as binary data
when reading some input it's less trouble to read it as binary data
though you will still need to decide how to treat any strings you want to use with Blender,
some importers do this.
@@ -679,7 +679,7 @@ Undo/Redo
---------
For safety, you should assume that undo and redo always invalidates all :class:`bpy.types.ID`
instances (Object, Scene, Mesh, Light, etc.), as weel obviously as all of their sub-data.
instances (Object, Scene, Mesh, Light, etc.), as well obviously as all of their sub-data.
This example shows how you can tell undo changes the memory locations:
@@ -716,7 +716,7 @@ Tools in Blender are not allowed to modify library data.
But Python does not enforce this restriction.
This can be useful in some cases, using a script to adjust material values for example.
But its also possible to use a script to make library data point to newly created local data,
But it's also possible to use a script to make library data point to newly created local data,
which is not supported since a call to undo will remove the local data
but leave the library referencing it and likely crash.
@@ -743,7 +743,7 @@ will re-allocate objects data,
any references to a meshes vertices/polygons/UVs, armatures bones,
curves points, etc. cannot be accessed after switching mode.
Only the reference to the data its self can be re-accessed, the following example will crash.
Only the reference to the data itself can be re-accessed, the following example will crash.
.. code-block:: python

View File

@@ -81,7 +81,7 @@ but reference an external file rather than including it directly.
Executing External Scripts
--------------------------
This is the equivalent to running the script directly, referencing a scripts path from a two line code block.
This is the equivalent to running the script directly, referencing a script's path from a two line code block.
.. code-block:: python
@@ -124,7 +124,7 @@ small script which is often useful for testing different settings quickly.
The other issue with this is the script has to be in Python's module search path.
While this is not best practice -- for testing purposes you can extend the search path,
this following example adds the current blend-files directory to the search path
this following example adds the current blend-file's directory to the search path
and then loads the script as a module.
.. code-block:: python
@@ -302,7 +302,7 @@ Python Safety (Build Option)
----------------------------
Since it's possible to access data which has been removed (see :doc:`Gotchas <info_gotcha>`),
can make it hard to track down the cause of crashes.
it can be hard to track down the cause of crashes.
To raise Python exceptions on accessing freed data (rather than crashing),
enable the CMake build option ``WITH_PYTHON_SAFETY``.
This enables data tracking which makes data access about two times slower

View File

@@ -417,7 +417,8 @@ MODULE_GROUPING = {
BLENDER_REVISION = str(bpy.app.build_hash, 'utf_8')
# '2.83.0 Beta' or '2.83.0' or '2.83.1'
BLENDER_VERSION_DOTS = bpy.app.version_string
BLENDER_VERSION_STRING = bpy.app.version_string
BLENDER_VERSION_DOTS = "%d.%d" % (bpy.app.version[0], bpy.app.version[1])
if BLENDER_REVISION != "Unknown":
# SHA1 Git hash
@@ -1724,11 +1725,11 @@ def write_sphinx_conf_py(basepath):
fw("import sys, os\n\n")
fw("extensions = ['sphinx.ext.intersphinx']\n\n")
fw("intersphinx_mapping = {'blender_manual': ('https://docs.blender.org/manual/en/dev/', None)}\n\n")
fw("project = 'Blender %s Python API'\n" % BLENDER_VERSION_DOTS)
fw("project = 'Blender %s Python API'\n" % BLENDER_VERSION_STRING)
fw("master_doc = 'index'\n")
fw("copyright = u'Blender Foundation'\n")
fw("version = '%s'\n" % BLENDER_VERSION_HASH)
fw("release = '%s'\n" % BLENDER_VERSION_HASH)
fw("version = '%s'\n" % BLENDER_VERSION_DOTS)
fw("release = '%s'\n" % BLENDER_VERSION_DOTS)
# Quiet file not in table-of-contents warnings.
fw("exclude_patterns = [\n")
@@ -1749,6 +1750,7 @@ except ModuleNotFoundError:
fw("if html_theme == 'sphinx_rtd_theme':\n")
fw(" html_theme_options = {\n")
fw(" 'display_version': False,\n")
# fw(" 'analytics_id': '',\n")
# fw(" 'collapse_navigation': True,\n")
fw(" 'sticky_navigation': False,\n")
@@ -1762,12 +1764,18 @@ except ModuleNotFoundError:
fw("html_show_sphinx = False\n")
fw("html_baseurl = 'https://docs.blender.org/api/current/'\n")
fw("html_use_opensearch = 'https://docs.blender.org/api/current'\n")
fw("html_show_search_summary = True\n")
fw("html_split_index = True\n")
fw("html_static_path = ['static']\n")
fw("templates_path = ['templates']\n")
fw("html_context = {'commit': '%s'}\n" % BLENDER_VERSION_HASH)
fw("html_extra_path = ['static/favicon.ico', 'static/blender_logo.svg']\n")
fw("html_favicon = 'static/favicon.ico'\n")
fw("html_logo = 'static/blender_logo.svg'\n")
fw("html_last_updated_fmt = '%m/%d/%Y'\n\n")
fw("if html_theme == 'sphinx_rtd_theme':\n")
fw(" html_css_files = ['css/version_switch.css']\n")
fw(" html_js_files = ['js/version_switch.js']\n")
# needed for latex, pdf gen
fw("latex_elements = {\n")
@@ -2124,6 +2132,9 @@ def copy_theme_assets(basepath):
shutil.copytree(os.path.join(SCRIPT_DIR, "static"),
os.path.join(basepath, "static"),
copy_function=shutil.copy)
shutil.copytree(os.path.join(SCRIPT_DIR, "templates"),
os.path.join(basepath, "templates"),
copy_function=shutil.copy)
def rna2sphinx(basepath):

View File

@@ -0,0 +1,127 @@
/* Override RTD theme */
.rst-versions {
border-top: 0px;
overflow: visible;
}
.version-btn.vdeact {
cursor: default;
color: dimgray;
}
.version-btn.vdeact::after {
content: "";
}
#versionwrap {
display: flex;
padding-top: 2px;
font-size: 90%;
justify-content: center;
flex-wrap: wrap;
}
.version-btn {
display: inline-block;
background-color: #272525;
width: 140px;
text-align: center;
padding: 3px 10px;
margin: 0px 5px 4px;
vertical-align: middle;
color: #27AE60;
border: solid 1px #444444;
border-radius: 3px;
cursor: pointer;
z-index: 400;
transition: border-color 0.4s;
}
.version-btn::after {
content:"\f0d8";
display: inline;
font: normal normal normal 16px/1 FontAwesome;
color: #8d8c8c;
vertical-align: top;
padding-left: 0.5em;
}
.version-btn-open::after {
color: gray;
}
.version-btn:hover, .version-btn:focus {
border-color: #525252;
}
.version-btn-open {
color: gray;
border: solid 1px gray;
}
.version-btn.wait {
cursor: wait;
}
.version-btn.disabled {
cursor: not-allowed;
color: dimgray;
}
.version-dialog {
display: none;
position: absolute;
bottom: 28px;
width: 140px;
margin: 0 5px;
padding-bottom: 4px;
background-color: #0003;
border-radius: 3px;
box-shadow: 0 0 6px #000C;
z-index: 999;
max-height: calc(100vh - 30px);
overflow-y: auto;
cursor: default;
}
.version-title {
padding: 5px;
color: black;
text-align: center;
font-size: 102%;
background-color: #27ae60;
border-bottom: solid 1.5px #444;
}
.version-list {
margin-bottom: 4px;
text-align: center;
background-color: #000C;
border: solid 1px gray;
border-radius: 0px 0px 3px 3px;
}
.version-list a, .version-list span, .version-list li {
position: relative;
display: block;
font-size: 98%;
line-height: 1.15;
width: 100%;
margin: 0;
padding: 4px 0px;
color: #404040;
}
.version-list li {
background-color: #ede9e9;
color: #404040;
padding: 1px;
}
.version-list li:hover, .version-list li a:focus {
background-color: #b9cfda;
}
.version-list li.selected, .version-list li.selected:hover {
background-color: #8d8c8c;
}
.version-list li.selected span {
cursor: default;
outline-color: red;
}
.version-arrow {
position: absolute;
width: 8px;
height: 8px;
left: 50%;
bottom: 4px;
margin-left: -4px;
transform: rotate(225deg);
background: #ede9e9;
border: 1px solid gray;
border-width: 1px 0 0 1px;
}

View File

@@ -0,0 +1,323 @@
(function() { // switch: v1.2
"use strict";
var versionsFileUrl = "https://docs.blender.org/PROD/versions.json"
var all_versions;
var Popover = function() {
function Popover(id)
{
this.isOpen = false;
this.type = (id === "version-popover");
this.$btn = $('#' + id);
this.$dialog = this.$btn.next();
this.$list = this.$dialog.children("ul");
this.sel = null;
this.beforeInit();
}
Popover.prototype = {
beforeInit : function() {
var that = this;
this.$btn.on("click", function(e) {
that.init();
e.preventDefault();
e.stopPropagation();
});
this.$btn.on("keydown", function(e) {
if (that.btnKeyFilter(e)) {
that.init();
e.preventDefault();
e.stopPropagation();
}
});
},
init : function() {
this.$btn.off("click");
this.$btn.off("keydown");
if (all_versions === undefined) {
this.$btn.addClass("wait");
this.loadVL(this);
}
else {
this.afterLoad();
}
},
loadVL : function(that) {
$.getJSON(versionsFileUrl, function(data) {
all_versions = data;
that.afterLoad();
return true;
}).fail(function() {
console.log("Version Switch Error: versions.json could not be loaded.");
that.$btn.addClass("disabled");
return false;
});
},
afterLoad : function() {
var release = DOCUMENTATION_OPTIONS.VERSION;
const m = release.match(/\d\.\d+/g);
if (m) {
release = m[0];
}
this.warnOld(release, all_versions);
var version = this.getNamed(release);
var list = this.buildList(version);
this.$list.children(":first-child").remove();
this.$list.append(list);
var that = this;
this.$list.on("keydown", function(e) {
that.keyMove(e);
});
this.$btn.removeClass("wait");
this.btnOpenHandler();
this.$btn.on("mousedown", function(e) {
that.btnOpenHandler();
e.preventDefault()
});
this.$btn.on("keydown", function(e) {
if (that.btnKeyFilter(e)) {
that.btnOpenHandler();
}
});
},
warnOld : function(release, all_versions) {
// Note this is effectively disabled now, two issues must fixed:
// * versions.js does not contain a current entry, because that leads to
// duplicate version numbers in the menu. These need to be deduplicated.
// * It only shows the warning after opening the menu to switch version
// when versions.js is loaded. This is too late to be useful.
var current = all_versions.current
if (!current)
{
// console.log("Version Switch Error: no 'current' in version.json.");
return;
}
const m = current.match(/\d\.\d+/g);
if (m) {
current = parseFloat(m[0]);
}
if (release < current) {
var currentURL = window.location.pathname.replace(release, current);
var warning = $('<div class="admonition warning"> ' +
'<p class="first admonition-title">Note</p> ' +
'<p class="last"> ' +
'You are not using the most up to date version of the documentation. ' +
'<a href="#"></a> is the newest version.' +
'</p>' +
'</div>');
warning.find('a').attr('href', currentURL).text(current);
var body = $("div.body");
if (!body.length) {
body = $("div.document");
}
body.prepend(warning);
}
},
buildList : function(v) {
var url = new URL(window.location.href);
let pathSplit = [ "", "api", v ];
if (url.pathname.startsWith("/api/")) {
pathSplit.push(url.pathname.split('/').slice(3).join('/'));
}
else {
pathSplit.push(url.pathname.substring(1));
}
if (this.type) {
var dyn = all_versions;
var cur = v;
}
var buf = [];
var that = this;
$.each(dyn, function(ix, title) {
buf.push("<li");
if (ix === cur) {
buf.push(
' class="selected" tabindex="-1" role="presentation"><span tabindex="-1" role="menuitem" aria-current="page">' +
title + '</spanp></li>');
}
else {
pathSplit[2 + that.type] = ix;
var href = new URL(url);
href.pathname = pathSplit.join('/');
buf.push(' tabindex="-1" role="presentation"><a href ="' + href + '" tabindex="-1">' +
title + '</a></li>');
}
});
return buf.join('');
},
getNamed : function(v) {
$.each(all_versions, function(ix, title) {
if (ix === "master" || ix === "latest") {
var m = title.match(/\d\.\d[\w\d\.]*/)[0];
if (parseFloat(m) == v) {
v = ix;
return false;
}
}
});
return v;
},
dialogToggle : function(speed) {
var wasClose = !this.isOpen;
var that = this;
if (!this.isOpen) {
this.$btn.addClass("version-btn-open");
this.$btn.attr("aria-pressed", true);
this.$dialog.attr("aria-hidden", false);
this.$dialog.fadeIn(speed, function() {
that.$btn.parent().on("focusout", function(e) {
that.focusoutHandler();
e.stopImmediatePropagation();
})
that.$btn.parent().on("mouseleave", function(e) {
that.mouseoutHandler();
e.stopImmediatePropagation();
});
});
this.isOpen = true;
}
else {
this.$btn.removeClass("version-btn-open");
this.$btn.attr("aria-pressed", false);
this.$dialog.attr("aria-hidden", true);
this.$btn.parent().off("focusout");
this.$btn.parent().off("mouseleave");
this.$dialog.fadeOut(speed, function() {
if (this.$sel) {
this.$sel.attr("tabindex", -1);
}
that.$btn.attr("tabindex", 0);
if (document.activeElement !== null && document.activeElement !== document &&
document.activeElement !== document.body) {
that.$btn.focus();
}
});
this.isOpen = false;
}
if (wasClose) {
if (this.$sel) {
this.$sel.attr("tabindex", -1);
}
if (document.activeElement !== null && document.activeElement !== document &&
document.activeElement !== document.body) {
var $nw = this.listEnter();
$nw.attr("tabindex", 0);
$nw.focus();
this.$sel = $nw;
}
}
},
btnOpenHandler : function() {
this.dialogToggle(300);
},
focusoutHandler : function() {
var list = this.$list;
var that = this;
setTimeout(function() {
if (list.find(":focus").length === 0) {
that.dialogToggle(200);
}
}, 200);
},
mouseoutHandler : function() {
this.dialogToggle(200);
},
btnKeyFilter : function(e) {
if (e.ctrlKey || e.shiftKey) {
return false;
}
if (e.key === " " || e.key === "Enter" || (e.key === "ArrowDown" && e.altKey) ||
e.key === "ArrowDown" || e.key === "ArrowUp") {
return true;
}
return false;
},
keyMove : function(e) {
if (e.ctrlKey || e.shiftKey) {
return true;
}
var p = true;
var $nw = $(e.target);
switch (e.key) {
case "ArrowUp":
$nw = this.listPrev($nw);
break;
case "ArrowDown":
$nw = this.listNext($nw);
break;
case "Home":
$nw = this.listFirst();
break;
case "End":
$nw = this.listLast();
break;
case "Escape":
$nw = this.listExit();
break;
case "ArrowLeft":
$nw = this.listExit();
break;
case "ArrowRight":
$nw = this.listExit();
break;
default:
p = false;
}
if (p) {
$nw.attr("tabindex", 0);
$nw.focus();
if (this.$sel) {
this.$sel.attr("tabindex", -1);
}
this.$sel = $nw;
e.preventDefault();
e.stopPropagation();
}
},
listPrev : function($nw) {
if ($nw.parent().prev().length !== 0) {
return $nw.parent().prev().children(":first-child");
}
else {
return this.listLast();
}
},
listNext : function($nw) {
if ($nw.parent().next().length !== 0) {
return $nw.parent().next().children(":first-child");
}
else {
return this.listFirst();
}
},
listFirst : function() {
return this.$list.children(":first-child").children(":first-child");
},
listLast : function() {
return this.$list.children(":last-child").children(":first-child");
},
listExit : function() {
this.mouseoutHandler();
return this.$btn;
},
listEnter : function() {
return this.$list.children(":first-child").children(":first-child");
}
};
return Popover
}();
$(document).ready(function() {
var lng_popover = new Popover("version-popover");
});
})();

View File

@@ -0,0 +1,17 @@
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="document versions">
<ul id="versionwrap" role="presentation">
<li role="presentation">
<span id="version-popover" class="version-btn" tabindex="0" role="button" aria-label="versions selector" aria-haspopup="true" aria-controls="version-vsnlist" aria-disabled="true">
{{ release }}
</span>
<div class="version-dialog" aria-hidden="true">
<div class="version-arrow" aria-hidden="true"></div>
<div class="version-title">Versions</div>
<ul id="version-vsnlist" class="version-list" role="menu" aria-labelledby="version-popover" aria-hidden="true">
<li role="presentation">Loading...</li>
</ul>
</div>
</li>
</ul>
</div>

View File

@@ -113,6 +113,6 @@ if(WITH_MOD_FLUID)
add_subdirectory(mantaflow)
endif()
if (WITH_COMPOSITOR)
if(WITH_COMPOSITOR)
add_subdirectory(smaa_areatex)
endif()

View File

@@ -1092,12 +1092,12 @@ if(WITH_PYTHON)
configure_file(${PYTHON_SOURCE_DIRECTORY}/setup.py.in ${CMAKE_CURRENT_BINARY_DIR}/setup.py ESCAPE_QUOTES @ONLY)
if(APPLE)
add_custom_command(OUTPUT build COMMAND MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} ${PYTHON_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR})
add_custom_command(OUTPUT build COMMAND MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} ${PYTHON_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR} setup.py)
elseif(WIN32)
set(ENV{VS100COMNTOOLS} $ENV{VS120COMNTOOLS})
add_custom_command(OUTPUT build COMMAND ${PYTHON_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR})
add_custom_command(OUTPUT build COMMAND ${PYTHON_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR} setup.py)
else()
add_custom_command(OUTPUT build COMMAND ${PYTHON_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR})
add_custom_command(OUTPUT build COMMAND ${PYTHON_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR} setup.py)
endif()
add_custom_target(pythonmodule ALL DEPENDS build SOURCES ${PYTHON_SOURCE_DIRECTORY}/setup.py.in ${PYTHON_SRC} ${PYTHON_HDR})
add_dependencies(pythonmodule audaspace)

View File

@@ -8,20 +8,20 @@ import numpy
from distutils.core import setup, Extension
if len(sys.argv) > 2 and sys.argv[1] == '--build-docs':
import subprocess
from distutils.core import Distribution
from distutils.command.build import build
import subprocess
from distutils.core import Distribution
from distutils.command.build import build
dist = Distribution()
cmd = build(dist)
cmd.finalize_options()
#print(cmd.build_platlib)
dist = Distribution()
cmd = build(dist)
cmd.finalize_options()
#print(cmd.build_platlib)
os.environ['PYTHONPATH'] = os.path.join(os.getcwd(), cmd.build_platlib)
os.environ['LD_LIBRARY_PATH'] = os.getcwd()
os.environ['PYTHONPATH'] = os.path.join(os.getcwd(), cmd.build_platlib)
os.environ['LD_LIBRARY_PATH'] = os.getcwd()
ret = subprocess.call(sys.argv[2:])
sys.exit(ret)
ret = subprocess.call(sys.argv[2:])
sys.exit(ret)
# the following line is not working due to https://bugs.python.org/issue9023
@@ -43,7 +43,8 @@ audaspace = Extension(
library_dirs = ['.', 'Release', 'Debug'],
language = 'c++',
extra_compile_args = extra_args,
sources = [os.path.join(source_directory, file) for file in ['PyAPI.cpp', 'PyDevice.cpp', 'PyHandle.cpp', 'PySound.cpp', 'PySequenceEntry.cpp', 'PySequence.cpp', 'PyPlaybackManager.cpp', 'PyDynamicMusic.cpp', 'PyThreadPool.cpp', 'PySource.cpp'] + (['PyImpulseResponse.cpp', 'PyHRTF.cpp'] if '@WITH_FFTW@' == 'ON' else [])]
define_macros = [('WITH_CONVOLUTION', None)] if '@WITH_FFTW@' == 'ON' else [],
sources = [os.path.join(source_directory, file) for file in ['PyAPI.cpp', 'PyDevice.cpp', 'PyHandle.cpp', 'PySound.cpp', 'PySequenceEntry.cpp', 'PySequence.cpp', 'PyPlaybackManager.cpp', 'PyDynamicMusic.cpp', 'PyThreadPool.cpp', 'PySource.cpp'] + (['PyImpulseResponse.cpp', 'PyHRTF.cpp'] if '@WITH_FFTW@' == 'ON' else [])]
)
setup(
@@ -56,6 +57,6 @@ setup(
license = 'Apache License 2.0',
long_description = codecs.open(os.path.join(source_directory, '../../README.md'), 'r', 'utf-8').read(),
ext_modules = [audaspace],
headers = [os.path.join(source_directory, file) for file in ['PyAPI.h', 'PyDevice.h', 'PyHandle.h', 'PySound.h', 'PySequenceEntry.h', 'PySequence.h', 'PyPlaybackManager.h', 'PyDynamicMusic.h', 'PyThreadPool.h', 'PySource.h'] + (['PyImpulseResponse.h', 'PyHRTF.h'] if '@WITH_FFTW@' == 'ON' else [])] + ['Audaspace.h']
headers = [os.path.join(source_directory, file) for file in ['PyAPI.h', 'PyDevice.h', 'PyHandle.h', 'PySound.h', 'PySequenceEntry.h', 'PySequence.h', 'PyPlaybackManager.h', 'PyDynamicMusic.h', 'PyThreadPool.h', 'PySource.h'] + (['PyImpulseResponse.h', 'PyHRTF.h'] if '@WITH_FFTW@' == 'ON' else [])] + ['Audaspace.h']
)

View File

@@ -95,6 +95,13 @@ void WASAPIDevice::runMixingThread()
sleep_duration = std::chrono::milliseconds(buffer_size * 1000 / int(m_specs.rate) / 2);
}
if(m_default_device_changed)
{
m_default_device_changed = false;
result = AUDCLNT_E_DEVICE_INVALIDATED;
goto stop_thread;
}
if(FAILED(result = m_audio_client->GetCurrentPadding(&padding)))
goto stop_thread;
@@ -296,13 +303,78 @@ bool WASAPIDevice::setupDevice(DeviceSpecs &specs)
return true;
}
ULONG WASAPIDevice::AddRef()
{
return InterlockedIncrement(&m_reference_count);
}
ULONG WASAPIDevice::Release()
{
ULONG reference_count = InterlockedDecrement(&m_reference_count);
if(0 == reference_count)
delete this;
return reference_count;
}
HRESULT WASAPIDevice::QueryInterface(REFIID riid, void **ppvObject)
{
if(riid == __uuidof(IMMNotificationClient))
{
*ppvObject = reinterpret_cast<IMMNotificationClient*>(this);
AddRef();
}
else if(riid == IID_IUnknown)
{
*ppvObject = reinterpret_cast<IUnknown*>(this);
AddRef();
}
else
{
*ppvObject = nullptr;
return E_NOINTERFACE;
}
return S_OK;
}
HRESULT WASAPIDevice::OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState)
{
return S_OK;
}
HRESULT WASAPIDevice::OnDeviceAdded(LPCWSTR pwstrDeviceId)
{
return S_OK;
}
HRESULT WASAPIDevice::OnDeviceRemoved(LPCWSTR pwstrDeviceId)
{
return S_OK;
}
HRESULT WASAPIDevice::OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR pwstrDeviceId)
{
if(flow != EDataFlow::eCapture)
m_default_device_changed = true;
return S_OK;
}
HRESULT WASAPIDevice::OnPropertyValueChanged(LPCWSTR pwstrDeviceId, const PROPERTYKEY key)
{
return S_OK;
}
WASAPIDevice::WASAPIDevice(DeviceSpecs specs, int buffersize) :
m_buffersize(buffersize),
m_imm_device_enumerator(nullptr),
m_imm_device(nullptr),
m_audio_client(nullptr),
m_wave_format_extensible({})
m_wave_format_extensible({}),
m_default_device_changed(false),
m_reference_count(1)
{
// initialize COM if it hasn't happened yet
CoInitializeEx(nullptr, COINIT_MULTITHREADED);
@@ -327,6 +399,8 @@ WASAPIDevice::WASAPIDevice(DeviceSpecs specs, int buffersize) :
create();
m_imm_device_enumerator->RegisterEndpointNotificationCallback(this);
return;
error:
@@ -340,6 +414,8 @@ WASAPIDevice::~WASAPIDevice()
{
stopMixingThread();
m_imm_device_enumerator->UnregisterEndpointNotificationCallback(this);
SafeRelease(&m_audio_client);
SafeRelease(&m_imm_device);
SafeRelease(&m_imm_device_enumerator);

View File

@@ -40,7 +40,7 @@ AUD_NAMESPACE_BEGIN
/**
* This device plays back through WASAPI, the Windows audio API.
*/
class AUD_PLUGIN_API WASAPIDevice : public ThreadedDevice
class AUD_PLUGIN_API WASAPIDevice : IMMNotificationClient, public ThreadedDevice
{
private:
int m_buffersize;
@@ -48,6 +48,8 @@ private:
IMMDevice* m_imm_device;
IAudioClient* m_audio_client;
WAVEFORMATEXTENSIBLE m_wave_format_extensible;
bool m_default_device_changed;
LONG m_reference_count;
AUD_LOCAL HRESULT setupRenderClient(IAudioRenderClient*& render_client, UINT32& buffer_size);
@@ -58,6 +60,17 @@ private:
AUD_LOCAL bool setupDevice(DeviceSpecs& specs);
// IUnknown implementation
ULONG STDMETHODCALLTYPE AddRef();
ULONG STDMETHODCALLTYPE Release();
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject);
// IMMNotificationClient implementation
HRESULT STDMETHODCALLTYPE OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState);
HRESULT STDMETHODCALLTYPE OnDeviceAdded(LPCWSTR pwstrDeviceId);
HRESULT STDMETHODCALLTYPE OnDeviceRemoved(LPCWSTR pwstrDeviceId);
HRESULT STDMETHODCALLTYPE OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR pwstrDeviceId);
HRESULT STDMETHODCALLTYPE OnPropertyValueChanged(LPCWSTR pwstrDeviceId, const PROPERTYKEY key);
// delete copy constructor and operator=
WASAPIDevice(const WASAPIDevice&) = delete;
WASAPIDevice& operator=(const WASAPIDevice&) = delete;

View File

@@ -51,8 +51,6 @@ list(APPEND LIBRARIES ${CYCLES_GL_LIBRARIES})
# Common configuration.
cycles_link_directories()
add_definitions(${GL_DEFINITIONS})
include_directories(${INC})

View File

@@ -140,7 +140,7 @@ if(WITH_OPENIMAGEDENOISE)
endif()
if(WITH_EXPERIMENTAL_FEATURES)
add_definitions(-DWITH_HAIR_NODES)
add_definitions(-DWITH_NEW_CURVES_TYPE)
endif()
blender_add_lib(bf_intern_cycles "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")

View File

@@ -74,7 +74,7 @@ enum_panorama_types = (
"Similar to most fisheye modern lens, takes sensor dimensions into consideration"),
('MIRRORBALL', "Mirror Ball", "Uses the mirror ball mapping"),
('FISHEYE_LENS_POLYNOMIAL', "Fisheye Lens Polynomial",
"Defines the lens projection as polynomial to allow real world camera lenses to be mimicked."),
"Defines the lens projection as polynomial to allow real world camera lenses to be mimicked"),
)
enum_curve_shape = (
@@ -667,6 +667,11 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
description="Use special type BVH optimized for hair (uses more ram but renders faster)",
default=True,
)
debug_use_compact_bvh: BoolProperty(
name="Use Compact BVH",
description="Use compact BVH structure (uses less ram but renders slower)",
default=True,
)
debug_bvh_time_steps: IntProperty(
name="BVH Time Steps",
description="Split BVH primitives by this number of time steps to speed up render time in cost of memory",
@@ -896,27 +901,27 @@ class CyclesCameraSettings(bpy.types.PropertyGroup):
fisheye_polynomial_k0: FloatProperty(
name="Fisheye Polynomial K0",
description="Coefficient K0 of the lens polinomial",
description="Coefficient K0 of the lens polynomial",
default=camera.default_fisheye_polynomial[0], precision=6, step=0.1, subtype='ANGLE',
)
fisheye_polynomial_k1: FloatProperty(
name="Fisheye Polynomial K1",
description="Coefficient K1 of the lens polinomial",
description="Coefficient K1 of the lens polynomial",
default=camera.default_fisheye_polynomial[1], precision=6, step=0.1, subtype='ANGLE',
)
fisheye_polynomial_k2: FloatProperty(
name="Fisheye Polynomial K2",
description="Coefficient K2 of the lens polinomial",
description="Coefficient K2 of the lens polynomial",
default=camera.default_fisheye_polynomial[2], precision=6, step=0.1, subtype='ANGLE',
)
fisheye_polynomial_k3: FloatProperty(
name="Fisheye Polynomial K3",
description="Coefficient K3 of the lens polinomial",
description="Coefficient K3 of the lens polynomial",
default=camera.default_fisheye_polynomial[3], precision=6, step=0.1, subtype='ANGLE',
)
fisheye_polynomial_k4: FloatProperty(
name="Fisheye Polynomial K4",
description="Coefficient K4 of the lens polinomial",
description="Coefficient K4 of the lens polynomial",
default=camera.default_fisheye_polynomial[4], precision=6, step=0.1, subtype='ANGLE',
)
@@ -1447,6 +1452,19 @@ class CyclesPreferences(bpy.types.AddonPreferences):
num += 1
return num
def has_multi_device(self):
import _cycles
compute_device_type = self.get_compute_device_type()
device_list = _cycles.available_devices(compute_device_type)
for device in device_list:
if device[1] == compute_device_type:
continue
for dev in self.devices:
if dev.use and dev.id == device[2]:
return True
return False
def has_active_device(self):
return self.get_num_gpu_devices() > 0

View File

@@ -118,11 +118,11 @@ def use_optix(context):
return (get_device_type(context) == 'OPTIX' and cscene.device == 'GPU')
def use_sample_all_lights(context):
def use_multi_device(context):
cscene = context.scene.cycles
return cscene.sample_all_lights_direct or cscene.sample_all_lights_indirect
if cscene.device != 'GPU':
return False
return context.preferences.addons[__package__].preferences.has_multi_device()
def show_device_active(context):
@@ -667,6 +667,10 @@ class CYCLES_RENDER_PT_performance_acceleration_structure(CyclesButtonsPanel, Pa
bl_label = "Acceleration Structure"
bl_parent_id = "CYCLES_RENDER_PT_performance"
@classmethod
def poll(cls, context):
return not use_optix(context) or use_multi_device(context)
def draw(self, context):
import _cycles
@@ -679,21 +683,33 @@ class CYCLES_RENDER_PT_performance_acceleration_structure(CyclesButtonsPanel, Pa
col = layout.column()
use_embree = False
use_embree = _cycles.with_embree
if use_cpu(context):
use_embree = _cycles.with_embree
if not use_embree:
col.prop(cscene, "debug_use_spatial_splits")
if use_embree:
col.prop(cscene, "debug_use_compact_bvh")
else:
sub = col.column()
sub.active = not cscene.debug_use_spatial_splits
sub.prop(cscene, "debug_bvh_time_steps")
col.prop(cscene, "debug_use_hair_bvh")
sub = col.column(align=True)
sub.label(text="Cycles built without Embree support")
sub.label(text="CPU raytracing performance will be poor")
else:
col.prop(cscene, "debug_use_spatial_splits")
sub = col.column()
sub.active = not cscene.debug_use_spatial_splits
sub.prop(cscene, "debug_bvh_time_steps")
col.prop(cscene, "debug_use_spatial_splits")
sub = col.column()
sub.active = not use_embree
sub.prop(cscene, "debug_use_hair_bvh")
sub = col.column()
sub.active = not cscene.debug_use_spatial_splits and not use_embree
sub.prop(cscene, "debug_bvh_time_steps")
col.prop(cscene, "debug_use_hair_bvh")
# CPU is used in addition to a GPU
if use_multi_device(context) and use_embree:
col.prop(cscene, "debug_use_compact_bvh")
class CYCLES_RENDER_PT_performance_final_render(CyclesButtonsPanel, Panel):
@@ -1803,18 +1819,45 @@ class CYCLES_RENDER_PT_bake_output(CyclesButtonsPanel, Panel):
rd = scene.render
if rd.use_bake_multires:
layout.prop(rd, "bake_margin")
layout.prop(rd, "use_bake_clear", text="Clear Image")
if rd.bake_type == 'DISPLACEMENT':
layout.prop(rd, "use_bake_lores_mesh")
else:
layout.prop(cbk, "target")
if cbk.target == 'IMAGE_TEXTURES':
layout.prop(cbk, "margin")
layout.prop(cbk, "use_clear", text="Clear Image")
class CYCLES_RENDER_PT_bake_output_margin(CyclesButtonsPanel, Panel):
bl_label = "Margin"
bl_context = "render"
bl_parent_id = "CYCLES_RENDER_PT_bake_output"
COMPAT_ENGINES = {'CYCLES'}
@classmethod
def poll(cls, context):
scene = context.scene
cbk = scene.render.bake
return cbk.target == 'IMAGE_TEXTURES'
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
scene = context.scene
cscene = scene.cycles
cbk = scene.render.bake
rd = scene.render
if rd.use_bake_multires:
layout.prop(rd, "bake_margin_type", text="Type")
layout.prop(rd, "bake_margin", text="Size")
else:
if cbk.target == 'IMAGE_TEXTURES':
layout.prop(cbk, "margin_type", text="Type")
layout.prop(cbk, "margin", text="Size")
class CYCLES_RENDER_PT_debug(CyclesDebugButtonsPanel, Panel):
bl_label = "Debug"
@@ -2183,6 +2226,7 @@ classes = (
CYCLES_RENDER_PT_bake_influence,
CYCLES_RENDER_PT_bake_selected_to_active,
CYCLES_RENDER_PT_bake_output,
CYCLES_RENDER_PT_bake_output_margin,
CYCLES_RENDER_PT_debug,
node_panel(CYCLES_MATERIAL_PT_settings),
node_panel(CYCLES_MATERIAL_PT_settings_surface),

View File

@@ -14,6 +14,8 @@
* limitations under the License.
*/
#include <optional>
#include "blender/sync.h"
#include "blender/util.h"
@@ -624,15 +626,36 @@ void BlenderSync::sync_particle_hair(
}
}
#ifdef WITH_HAIR_NODES
static float4 hair_point_as_float4(BL::HairPoint b_point)
#ifdef WITH_NEW_CURVES_TYPE
static std::optional<BL::FloatAttribute> find_curves_radius_attribute(BL::Curves b_curves)
{
float4 mP = float3_to_float4(get_float3(b_point.co()));
mP.w = b_point.radius();
for (BL::Attribute &b_attribute : b_curves.attributes) {
if (b_attribute.name() != "radius") {
continue;
}
if (b_attribute.domain() != BL::Attribute::domain_POINT) {
continue;
}
if (b_attribute.data_type() != BL::Attribute::data_type_FLOAT) {
continue;
}
return BL::FloatAttribute{b_attribute};
}
return std::nullopt;
}
static float4 hair_point_as_float4(BL::Curves b_curves,
std::optional<BL::FloatAttribute> b_attr_radius,
const int index)
{
float4 mP = float3_to_float4(get_float3(b_curves.position_data[index].vector()));
mP.w = b_attr_radius ? b_attr_radius->data[index].value() : 0.0f;
return mP;
}
static float4 interpolate_hair_points(BL::Hair b_hair,
static float4 interpolate_hair_points(BL::Curves b_curves,
std::optional<BL::FloatAttribute> b_attr_radius,
const int first_point_index,
const int num_points,
const float step)
@@ -641,12 +664,12 @@ static float4 interpolate_hair_points(BL::Hair b_hair,
const int point_a = clamp((int)curve_t, 0, num_points - 1);
const int point_b = min(point_a + 1, num_points - 1);
const float t = curve_t - (float)point_a;
return lerp(hair_point_as_float4(b_hair.points[first_point_index + point_a]),
hair_point_as_float4(b_hair.points[first_point_index + point_b]),
return lerp(hair_point_as_float4(b_curves, b_attr_radius, first_point_index + point_a),
hair_point_as_float4(b_curves, b_attr_radius, first_point_index + point_b),
t);
}
static void export_hair_curves(Scene *scene, Hair *hair, BL::Hair b_hair)
static void export_hair_curves(Scene *scene, Hair *hair, BL::Curves b_curves)
{
/* TODO: optimize so we can straight memcpy arrays from Blender? */
@@ -666,17 +689,19 @@ static void export_hair_curves(Scene *scene, Hair *hair, BL::Hair b_hair)
}
/* Reserve memory. */
const int num_keys = b_hair.points.length();
const int num_curves = b_hair.curves.length();
const int num_keys = b_curves.points.length();
const int num_curves = b_curves.curves.length();
hair->reserve_curves(num_curves, num_keys);
std::optional<BL::FloatAttribute> b_attr_radius = find_curves_radius_attribute(b_curves);
/* Export curves and points. */
vector<float> points_length;
for (BL::HairCurve &b_curve : b_hair.curves) {
const int first_point_index = b_curve.first_point_index();
const int num_points = b_curve.num_points();
for (int i = 0; i < num_curves; i++) {
const int first_point_index = b_curves.curve_offset_data[i].value();
const int num_points = b_curves.curve_offset_data[i + 1].value() - first_point_index;
float3 prev_co = zero_float3();
float length = 0.0f;
@@ -687,10 +712,9 @@ static void export_hair_curves(Scene *scene, Hair *hair, BL::Hair b_hair)
/* Position and radius. */
for (int i = 0; i < num_points; i++) {
BL::HairPoint b_point = b_hair.points[first_point_index + i];
const float3 co = get_float3(b_point.co());
const float radius = b_point.radius();
const float3 co = get_float3(b_curves.position_data[first_point_index + i].vector());
const float radius = b_attr_radius ? b_attr_radius->data[first_point_index + i].value() :
0.0f;
hair->add_curve_key(co, radius);
if (attr_intercept) {
@@ -715,7 +739,7 @@ static void export_hair_curves(Scene *scene, Hair *hair, BL::Hair b_hair)
/* Random number per curve. */
if (attr_random != NULL) {
attr_random->add(hash_uint2_to_float(b_curve.index(), 0));
attr_random->add(hash_uint2_to_float(i, 0));
}
/* Curve. */
@@ -724,7 +748,7 @@ static void export_hair_curves(Scene *scene, Hair *hair, BL::Hair b_hair)
}
}
static void export_hair_curves_motion(Hair *hair, BL::Hair b_hair, int motion_step)
static void export_hair_curves_motion(Hair *hair, BL::Curves b_curves, int motion_step)
{
/* Find or add attribute. */
Attribute *attr_mP = hair->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
@@ -737,14 +761,17 @@ static void export_hair_curves_motion(Hair *hair, BL::Hair b_hair, int motion_st
/* Export motion keys. */
const int num_keys = hair->get_curve_keys().size();
const int num_curves = b_curves.curves.length();
float4 *mP = attr_mP->data_float4() + motion_step * num_keys;
bool have_motion = false;
int num_motion_keys = 0;
int curve_index = 0;
for (BL::HairCurve &b_curve : b_hair.curves) {
const int first_point_index = b_curve.first_point_index();
const int num_points = b_curve.num_points();
std::optional<BL::FloatAttribute> b_attr_radius = find_curves_radius_attribute(b_curves);
for (int i = 0; i < num_curves; i++) {
const int first_point_index = b_curves.curve_offset_data[i].value();
const int num_points = b_curves.curve_offset_data[i + 1].value() - first_point_index;
Hair::Curve curve = hair->get_curve(curve_index);
curve_index++;
@@ -755,7 +782,7 @@ static void export_hair_curves_motion(Hair *hair, BL::Hair b_hair, int motion_st
int point_index = first_point_index + i;
if (point_index < num_keys) {
mP[num_motion_keys] = hair_point_as_float4(b_hair.points[point_index]);
mP[num_motion_keys] = hair_point_as_float4(b_curves, b_attr_radius, point_index);
num_motion_keys++;
if (!have_motion) {
@@ -774,7 +801,8 @@ static void export_hair_curves_motion(Hair *hair, BL::Hair b_hair, int motion_st
const float step_size = curve.num_keys > 1 ? 1.0f / (curve.num_keys - 1) : 0.0f;
for (int i = 0; i < curve.num_keys; i++) {
const float step = i * step_size;
mP[num_motion_keys] = interpolate_hair_points(b_hair, first_point_index, num_points, step);
mP[num_motion_keys] = interpolate_hair_points(
b_curves, b_attr_radius, first_point_index, num_points, step);
num_motion_keys++;
}
have_motion = true;
@@ -791,12 +819,12 @@ static void export_hair_curves_motion(Hair *hair, BL::Hair b_hair, int motion_st
void BlenderSync::sync_hair(Hair *hair, BObjectInfo &b_ob_info, bool motion, int motion_step)
{
/* Convert Blender hair to Cycles curves. */
BL::Hair b_hair(b_ob_info.object_data);
BL::Curves b_curves(b_ob_info.object_data);
if (motion) {
export_hair_curves_motion(hair, b_hair, motion_step);
export_hair_curves_motion(hair, b_curves, motion_step);
}
else {
export_hair_curves(scene, hair, b_hair);
export_hair_curves(scene, hair, b_curves);
}
}
#else
@@ -819,8 +847,8 @@ void BlenderSync::sync_hair(BL::Depsgraph b_depsgraph, BObjectInfo &b_ob_info, H
new_hair.set_used_shaders(used_shaders);
if (view_layer.use_hair) {
#ifdef WITH_HAIR_NODES
if (b_ob_info.object_data.is_a(&RNA_Hair)) {
#ifdef WITH_NEW_CURVES_TYPE
if (b_ob_info.object_data.is_a(&RNA_Curves)) {
/* Hair object. */
sync_hair(&new_hair, b_ob_info, false);
}
@@ -873,8 +901,8 @@ void BlenderSync::sync_hair_motion(BL::Depsgraph b_depsgraph,
/* Export deformed coordinates. */
if (ccl::BKE_object_is_deform_modified(b_ob_info, b_scene, preview)) {
#ifdef WITH_HAIR_NODES
if (b_ob_info.object_data.is_a(&RNA_Hair)) {
#ifdef WITH_NEW_CURVES_TYPE
if (b_ob_info.object_data.is_a(&RNA_Curves)) {
/* Hair object. */
sync_hair(hair, b_ob_info, true, motion_step);
return;

View File

@@ -32,8 +32,8 @@ CCL_NAMESPACE_BEGIN
static Geometry::Type determine_geom_type(BObjectInfo &b_ob_info, bool use_particle_hair)
{
#ifdef WITH_HAIR_NODES
if (b_ob_info.object_data.is_a(&RNA_Hair) || use_particle_hair) {
#ifdef WITH_NEW_CURVES_TYPE
if (b_ob_info.object_data.is_a(&RNA_Curves) || use_particle_hair) {
#else
if (use_particle_hair) {
#endif
@@ -231,8 +231,8 @@ void BlenderSync::sync_geometry_motion(BL::Depsgraph &b_depsgraph,
if (progress.get_cancel())
return;
#ifdef WITH_HAIR_NODES
if (b_ob_info.object_data.is_a(&RNA_Hair) || use_particle_hair) {
#ifdef WITH_NEW_CURVES_TYPE
if (b_ob_info.object_data.is_a(&RNA_Curves) || use_particle_hair) {
#else
if (use_particle_hair) {
#endif

View File

@@ -1071,7 +1071,15 @@ static void create_subd_mesh(Scene *scene,
for (BL::MeshEdge &e : b_mesh.edges) {
if (e.crease() != 0.0f) {
mesh->add_crease(e.vertices()[0], e.vertices()[1], e.crease());
mesh->add_edge_crease(e.vertices()[0], e.vertices()[1], e.crease());
}
}
for (BL::MeshVertexCreaseLayer &c : b_mesh.vertex_creases) {
for (int i = 0; i < c.data.length(); ++i) {
if (c.data[i].value() != 0.0f) {
mesh->add_vertex_crease(i, c.data[i].value());
}
}
}

View File

@@ -72,7 +72,7 @@ bool BlenderSync::object_is_geometry(BObjectInfo &b_ob_info)
BL::Object::type_enum type = b_ob_info.iter_object.type();
if (type == BL::Object::type_VOLUME || type == BL::Object::type_HAIR ||
if (type == BL::Object::type_VOLUME || type == BL::Object::type_CURVES ||
type == BL::Object::type_POINTCLOUD) {
/* Will be exported attached to mesh. */
return true;
@@ -97,7 +97,7 @@ bool BlenderSync::object_can_have_geometry(BL::Object &b_ob)
case BL::Object::type_SURFACE:
case BL::Object::type_META:
case BL::Object::type_FONT:
case BL::Object::type_HAIR:
case BL::Object::type_CURVES:
case BL::Object::type_POINTCLOUD:
case BL::Object::type_VOLUME:
return true;
@@ -529,6 +529,17 @@ void BlenderSync::sync_procedural(BL::Object &b_ob,
string absolute_path = blender_absolute_path(b_data, b_ob, b_mesh_cache.cache_file().filepath());
procedural->set_filepath(ustring(absolute_path));
array<ustring> layers;
for (BL::CacheFileLayer &layer : cache_file.layers) {
if (layer.hide_layer()) {
continue;
}
absolute_path = blender_absolute_path(b_data, b_ob, layer.filepath());
layers.push_back_slow(ustring(absolute_path));
}
procedural->set_layers(layers);
procedural->set_scale(cache_file.scale());
procedural->set_use_prefetch(cache_file.use_prefetch());

View File

@@ -51,8 +51,6 @@ bool BlenderOutputDriver::read_render_tile(const Tile &tile)
BL::RenderLayer b_rlay = *b_single_rlay;
vector<float> pixels(tile.size.x * tile.size.y * 4);
/* Copy each pass.
* TODO:copy only the required ones for better performance? */
for (BL::RenderPass &b_pass : b_rlay.passes) {
@@ -109,7 +107,7 @@ void BlenderOutputDriver::write_render_tile(const Tile &tile)
BL::RenderLayer b_rlay = *b_single_rlay;
vector<float> pixels(tile.size.x * tile.size.y * 4);
vector<float> pixels(static_cast<size_t>(tile.size.x) * tile.size.y * 4);
/* Copy each pass. */
for (BL::RenderPass &b_pass : b_rlay.passes) {

View File

@@ -689,6 +689,9 @@ static ShaderNode *add_node(Scene *scene,
else if (b_node.is_a(&RNA_ShaderNodeHairInfo)) {
node = graph->create_node<HairInfoNode>();
}
else if (b_node.is_a(&RNA_ShaderNodePointInfo)) {
node = graph->create_node<PointInfoNode>();
}
else if (b_node.is_a(&RNA_ShaderNodeVolumeInfo)) {
node = graph->create_node<VolumeInfoNode>();
}

View File

@@ -787,6 +787,7 @@ SceneParams BlenderSync::get_scene_params(BL::Scene &b_scene, bool background)
params.bvh_type = BVH_TYPE_DYNAMIC;
params.use_bvh_spatial_split = RNA_boolean_get(&cscene, "debug_use_spatial_splits");
params.use_bvh_compact_structure = RNA_boolean_get(&cscene, "debug_use_compact_bvh");
params.use_bvh_unaligned_nodes = RNA_boolean_get(&cscene, "debug_use_hair_bvh");
params.num_bvh_time_steps = RNA_int_get(&cscene, "debug_bvh_time_steps");

View File

@@ -935,7 +935,7 @@ BVHNode *BVHBuild::create_object_leaf_nodes(const BVHReference *ref, int start,
BVHNode *BVHBuild::create_leaf_node(const BVHRange &range, const vector<BVHReference> &references)
{
/* This is a bit overallocating here (considering leaf size into account),
/* This is a bit over-allocating here (considering leaf size into account),
* but chunk-based re-allocation in vector makes it difficult to use small
* size of stack storage here. Some tweaks are possible tho.
*

View File

@@ -61,6 +61,26 @@ static_assert(Object::MAX_MOTION_STEPS == Geometry::MAX_MOTION_STEPS,
# define IS_HAIR(x) (x & 1)
/* This gets called by Embree at every valid ray/object intersection.
* Things like recording subsurface or shadow hits for later evaluation
* as well as filtering for volume objects happen here.
* Cycles' own BVH does that directly inside the traversal calls.
*/
static void rtc_filter_intersection_func(const RTCFilterFunctionNArguments *args)
{
/* Current implementation in Cycles assumes only single-ray intersection queries. */
assert(args->N == 1);
RTCHit *hit = (RTCHit *)args->hit;
CCLIntersectContext *ctx = ((IntersectContext *)args->context)->userRayExt;
const KernelGlobalsCPU *kg = ctx->kg;
const Ray *cray = ctx->ray;
if (kernel_embree_is_self_intersection(kg, hit, cray)) {
*args->valid = 0;
}
}
/* This gets called by Embree at every valid ray/object intersection.
* Things like recording subsurface or shadow hits for later evaluation
* as well as filtering for volume objects happen here.
@@ -75,12 +95,16 @@ static void rtc_filter_occluded_func(const RTCFilterFunctionNArguments *args)
RTCHit *hit = (RTCHit *)args->hit;
CCLIntersectContext *ctx = ((IntersectContext *)args->context)->userRayExt;
const KernelGlobalsCPU *kg = ctx->kg;
const Ray *cray = ctx->ray;
switch (ctx->type) {
case CCLIntersectContext::RAY_SHADOW_ALL: {
Intersection current_isect;
kernel_embree_convert_hit(kg, ray, hit, &current_isect);
if (intersection_skip_self_shadow(cray->self, current_isect.object, current_isect.prim)) {
*args->valid = 0;
return;
}
/* If no transparent shadows or max number of hits exceeded, all light is blocked. */
const int flags = intersection_get_shader_flags(kg, current_isect.prim, current_isect.type);
if (!(flags & (SD_HAS_TRANSPARENT_SHADOW)) || ctx->num_hits >= ctx->max_hits) {
@@ -160,6 +184,10 @@ static void rtc_filter_occluded_func(const RTCFilterFunctionNArguments *args)
break;
}
}
if (intersection_skip_self_local(cray->self, current_isect.prim)) {
*args->valid = 0;
return;
}
/* No intersection information requested, just return a hit. */
if (ctx->max_hits == 0) {
@@ -225,6 +253,11 @@ static void rtc_filter_occluded_func(const RTCFilterFunctionNArguments *args)
if (ctx->num_hits < ctx->max_hits) {
Intersection current_isect;
kernel_embree_convert_hit(kg, ray, hit, &current_isect);
if (intersection_skip_self(cray->self, current_isect.object, current_isect.prim)) {
*args->valid = 0;
return;
}
Intersection *isect = &ctx->isect_s[ctx->num_hits];
++ctx->num_hits;
*isect = current_isect;
@@ -236,12 +269,15 @@ static void rtc_filter_occluded_func(const RTCFilterFunctionNArguments *args)
}
/* This tells Embree to continue tracing. */
*args->valid = 0;
break;
}
break;
}
case CCLIntersectContext::RAY_REGULAR:
default:
/* Nothing to do here. */
if (kernel_embree_is_self_intersection(kg, hit, cray)) {
*args->valid = 0;
return;
}
break;
}
}
@@ -257,6 +293,14 @@ static void rtc_filter_func_backface_cull(const RTCFilterFunctionNArguments *arg
*args->valid = 0;
return;
}
CCLIntersectContext *ctx = ((IntersectContext *)args->context)->userRayExt;
const KernelGlobalsCPU *kg = ctx->kg;
const Ray *cray = ctx->ray;
if (kernel_embree_is_self_intersection(kg, hit, cray)) {
*args->valid = 0;
}
}
static void rtc_filter_occluded_func_backface_cull(const RTCFilterFunctionNArguments *args)
@@ -355,10 +399,12 @@ void BVHEmbree::build(Progress &progress, Stats *stats, RTCDevice rtc_device_)
}
const bool dynamic = params.bvh_type == BVH_TYPE_DYNAMIC;
const bool compact = params.use_compact_structure;
scene = rtcNewScene(rtc_device);
const RTCSceneFlags scene_flags = (dynamic ? RTC_SCENE_FLAG_DYNAMIC : RTC_SCENE_FLAG_NONE) |
RTC_SCENE_FLAG_COMPACT | RTC_SCENE_FLAG_ROBUST;
(compact ? RTC_SCENE_FLAG_COMPACT : RTC_SCENE_FLAG_NONE) |
RTC_SCENE_FLAG_ROBUST;
rtcSetSceneFlags(scene, scene_flags);
build_quality = dynamic ? RTC_BUILD_QUALITY_LOW :
(params.use_spatial_split ? RTC_BUILD_QUALITY_HIGH :
@@ -425,7 +471,7 @@ void BVHEmbree::add_instance(Object *ob, int i)
assert(instance_bvh != NULL);
const size_t num_object_motion_steps = ob->use_motion() ? ob->get_motion().size() : 1;
const size_t num_motion_steps = min(num_object_motion_steps, RTC_MAX_TIME_STEP_COUNT);
const size_t num_motion_steps = min(num_object_motion_steps, (size_t)RTC_MAX_TIME_STEP_COUNT);
assert(num_object_motion_steps <= RTC_MAX_TIME_STEP_COUNT);
RTCGeometry geom_id = rtcNewGeometry(rtc_device, RTC_GEOMETRY_TYPE_INSTANCE);
@@ -476,7 +522,7 @@ void BVHEmbree::add_triangles(const Object *ob, const Mesh *mesh, int i)
}
assert(num_motion_steps <= RTC_MAX_TIME_STEP_COUNT);
num_motion_steps = min(num_motion_steps, RTC_MAX_TIME_STEP_COUNT);
num_motion_steps = min(num_motion_steps, (size_t)RTC_MAX_TIME_STEP_COUNT);
const size_t num_triangles = mesh->num_triangles();
@@ -503,6 +549,7 @@ void BVHEmbree::add_triangles(const Object *ob, const Mesh *mesh, int i)
rtcSetGeometryUserData(geom_id, (void *)prim_offset);
rtcSetGeometryOccludedFilterFunction(geom_id, rtc_filter_occluded_func);
rtcSetGeometryIntersectFilterFunction(geom_id, rtc_filter_intersection_func);
rtcSetGeometryMask(geom_id, ob->visibility_for_tracing());
rtcCommitGeometry(geom_id);
@@ -728,7 +775,7 @@ void BVHEmbree::add_curves(const Object *ob, const Hair *hair, int i)
}
assert(num_motion_steps <= RTC_MAX_TIME_STEP_COUNT);
num_motion_steps = min(num_motion_steps, RTC_MAX_TIME_STEP_COUNT);
num_motion_steps = min(num_motion_steps, (size_t)RTC_MAX_TIME_STEP_COUNT);
const size_t num_curves = hair->num_curves();
size_t num_segments = 0;
@@ -765,6 +812,7 @@ void BVHEmbree::add_curves(const Object *ob, const Hair *hair, int i)
rtcSetGeometryUserData(geom_id, (void *)prim_offset);
if (hair->curve_shape == CURVE_RIBBON) {
rtcSetGeometryIntersectFilterFunction(geom_id, rtc_filter_intersection_func);
rtcSetGeometryOccludedFilterFunction(geom_id, rtc_filter_occluded_func);
}
else {

View File

@@ -97,6 +97,9 @@ class BVHParams {
*/
bool use_unaligned_nodes;
/* Use compact acceleration structure (Embree)*/
bool use_compact_structure;
/* Split time range to this number of steps and create leaf node for each
* of this time steps.
*
@@ -139,6 +142,7 @@ class BVHParams {
top_level = false;
bvh_layout = BVH_LAYOUT_BVH2;
use_compact_structure = true;
use_unaligned_nodes = false;
num_motion_curve_steps = 0;

View File

@@ -559,10 +559,10 @@ if(WITH_CYCLES_DEVICE_METAL)
find_library(METAL_LIBRARY Metal)
# This file was added in the 12.0 SDK, use it as a way to detect the version.
if (METAL_LIBRARY AND NOT EXISTS "${METAL_LIBRARY}/Headers/MTLFunctionStitching.h")
if(METAL_LIBRARY AND NOT EXISTS "${METAL_LIBRARY}/Headers/MTLFunctionStitching.h")
message(STATUS "Metal version too old, must be SDK 12.0 or newer, disabling WITH_CYCLES_DEVICE_METAL")
set(WITH_CYCLES_DEVICE_METAL OFF)
elseif (NOT METAL_LIBRARY)
elseif(NOT METAL_LIBRARY)
message(STATUS "Metal not found, disabling WITH_CYCLES_DEVICE_METAL")
set(WITH_CYCLES_DEVICE_METAL OFF)
else()

View File

@@ -84,39 +84,6 @@ macro(cycles_add_library target library_deps)
cycles_set_solution_folder(${target})
endmacro()
# Cycles library dependencies common to all executables
function(cycles_link_directories)
if(APPLE)
# APPLE platform uses full paths for linking libraries, and avoids link_directories.
return()
endif()
if(WITH_OPENCOLORIO)
link_directories(${OPENCOLORIO_LIBPATH})
endif()
if(WITH_OPENVDB)
link_directories(${OPENVDB_LIBPATH} ${BLOSC_LIBPATH})
endif()
if(WITH_OPENSUBDIV)
link_directories(${OPENSUBDIV_LIBPATH})
endif()
if(WITH_OPENIMAGEDENOISE)
link_directories(${OPENIMAGEDENOISE_LIBPATH})
endif()
link_directories(
${OPENIMAGEIO_LIBPATH}
${BOOST_LIBPATH}
${PNG_LIBPATH}
${JPEG_LIBPATH}
${ZLIB_LIBPATH}
${TIFF_LIBPATH}
${OPENEXR_LIBPATH}
${OPENJPEG_LIBPATH}
)
endfunction()
macro(cycles_target_link_libraries target)
if(WITH_CYCLES_LOGGING)
target_link_libraries(${target} ${GLOG_LIBRARIES} ${GFLAGS_LIBRARIES})

View File

@@ -72,7 +72,7 @@ CPUDevice::CPUDevice(const DeviceInfo &info_, Stats &stats_, Profiler &profiler_
<< " CPU kernels.";
if (info.cpu_threads == 0) {
info.cpu_threads = TaskScheduler::num_threads();
info.cpu_threads = TaskScheduler::max_concurrency();
}
#ifdef WITH_OSL

View File

@@ -334,8 +334,8 @@ DeviceInfo Device::get_multi_device(const vector<DeviceInfo> &subdevices,
/* Ensure CPU device does not slow down GPU. */
if (device.type == DEVICE_CPU && subdevices.size() > 1) {
if (background) {
int orig_cpu_threads = (threads) ? threads : TaskScheduler::num_threads();
int cpu_threads = max(orig_cpu_threads - (subdevices.size() - 1), 0);
int orig_cpu_threads = (threads) ? threads : TaskScheduler::max_concurrency();
int cpu_threads = max(orig_cpu_threads - (subdevices.size() - 1), size_t(0));
VLOG(1) << "CPU render threads reduced from " << orig_cpu_threads << " to " << cpu_threads
<< ", to dedicate to GPU.";

View File

@@ -905,8 +905,8 @@ void HIPDevice::tex_alloc(device_texture &mem)
address_mode = hipAddressModeClamp;
break;
case EXTENSION_CLIP:
// TODO : (Arya) setting this to Mode Clamp instead of Mode Border because it's unsupported
// in hip
/* TODO(@arya): setting this to Mode Clamp instead of Mode Border
* because it's unsupported in HIP. */
address_mode = hipAddressModeClamp;
break;
default:

View File

@@ -311,7 +311,7 @@ template<typename T> class device_only_memory : public device_memory {
: device_memory(device, name, allow_host_memory_fallback ? MEM_READ_WRITE : MEM_DEVICE_ONLY)
{
data_type = device_type_traits<T>::data_type;
data_elements = max(device_type_traits<T>::num_elements, 1);
data_elements = max(device_type_traits<T>::num_elements, size_t(1));
}
device_only_memory(device_only_memory &&other) noexcept : device_memory(std::move(other))

View File

@@ -58,6 +58,11 @@ class BVHMetal : public BVH {
id<MTLCommandQueue> queue,
Geometry *const geom,
bool refit);
bool build_BLAS_pointcloud(Progress &progress,
id<MTLDevice> device,
id<MTLCommandQueue> queue,
Geometry *const geom,
bool refit);
bool build_TLAS(Progress &progress, id<MTLDevice> device, id<MTLCommandQueue> queue, bool refit);
};

View File

@@ -19,6 +19,7 @@
# include "scene/hair.h"
# include "scene/mesh.h"
# include "scene/object.h"
# include "scene/pointcloud.h"
# include "util/progress.h"
@@ -475,6 +476,220 @@ bool BVHMetal::build_BLAS_hair(Progress &progress,
return false;
}
bool BVHMetal::build_BLAS_pointcloud(Progress &progress,
id<MTLDevice> device,
id<MTLCommandQueue> queue,
Geometry *const geom,
bool refit)
{
if (@available(macos 12.0, *)) {
/* Build BLAS for point cloud */
PointCloud *pointcloud = static_cast<PointCloud *>(geom);
if (pointcloud->num_points() == 0) {
return false;
}
/*------------------------------------------------*/
BVH_status("Building pointcloud BLAS | %7d points | %s",
(int)pointcloud->num_points(),
geom->name.c_str());
/*------------------------------------------------*/
const size_t num_points = pointcloud->get_points().size();
const float3 *points = pointcloud->get_points().data();
const float *radius = pointcloud->get_radius().data();
const bool use_fast_trace_bvh = (params.bvh_type == BVH_TYPE_STATIC);
size_t num_motion_steps = 1;
Attribute *motion_keys = pointcloud->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
if (motion_blur && pointcloud->get_use_motion_blur() && motion_keys) {
num_motion_steps = pointcloud->get_motion_steps();
}
const size_t num_aabbs = num_motion_steps;
MTLResourceOptions storage_mode;
if (device.hasUnifiedMemory) {
storage_mode = MTLResourceStorageModeShared;
}
else {
storage_mode = MTLResourceStorageModeManaged;
}
/* Allocate a GPU buffer for the AABB data and populate it */
id<MTLBuffer> aabbBuf = [device
newBufferWithLength:num_aabbs * sizeof(MTLAxisAlignedBoundingBox)
options:storage_mode];
MTLAxisAlignedBoundingBox *aabb_data = (MTLAxisAlignedBoundingBox *)[aabbBuf contents];
/* Get AABBs for each motion step */
size_t center_step = (num_motion_steps - 1) / 2;
for (size_t step = 0; step < num_motion_steps; ++step) {
/* The center step for motion vertices is not stored in the attribute */
if (step != center_step) {
size_t attr_offset = (step > center_step) ? step - 1 : step;
points = motion_keys->data_float3() + attr_offset * num_points;
}
for (size_t j = 0; j < num_points; ++j) {
const PointCloud::Point point = pointcloud->get_point(j);
BoundBox bounds = BoundBox::empty;
point.bounds_grow(points, radius, bounds);
const size_t index = step * num_points + j;
aabb_data[index].min = (MTLPackedFloat3 &)bounds.min;
aabb_data[index].max = (MTLPackedFloat3 &)bounds.max;
}
}
if (storage_mode == MTLResourceStorageModeManaged) {
[aabbBuf didModifyRange:NSMakeRange(0, aabbBuf.length)];
}
# if 0
for (size_t i=0; i<num_aabbs && i < 400; i++) {
MTLAxisAlignedBoundingBox& bb = aabb_data[i];
printf(" %d: %.1f,%.1f,%.1f -- %.1f,%.1f,%.1f\n", int(i), bb.min.x, bb.min.y, bb.min.z, bb.max.x, bb.max.y, bb.max.z);
}
# endif
MTLAccelerationStructureGeometryDescriptor *geomDesc;
if (motion_blur) {
std::vector<MTLMotionKeyframeData *> aabb_ptrs;
aabb_ptrs.reserve(num_motion_steps);
for (size_t step = 0; step < num_motion_steps; ++step) {
MTLMotionKeyframeData *k = [MTLMotionKeyframeData data];
k.buffer = aabbBuf;
k.offset = step * num_points * sizeof(MTLAxisAlignedBoundingBox);
aabb_ptrs.push_back(k);
}
MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor *geomDescMotion =
[MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor descriptor];
geomDescMotion.boundingBoxBuffers = [NSArray arrayWithObjects:aabb_ptrs.data()
count:aabb_ptrs.size()];
geomDescMotion.boundingBoxCount = num_points;
geomDescMotion.boundingBoxStride = sizeof(aabb_data[0]);
geomDescMotion.intersectionFunctionTableOffset = 2;
/* Force a single any-hit call, so shadow record-all behavior works correctly */
/* (Match optix behavior: unsigned int build_flags =
* OPTIX_GEOMETRY_FLAG_REQUIRE_SINGLE_ANYHIT_CALL;) */
geomDescMotion.allowDuplicateIntersectionFunctionInvocation = false;
geomDescMotion.opaque = true;
geomDesc = geomDescMotion;
}
else {
MTLAccelerationStructureBoundingBoxGeometryDescriptor *geomDescNoMotion =
[MTLAccelerationStructureBoundingBoxGeometryDescriptor descriptor];
geomDescNoMotion.boundingBoxBuffer = aabbBuf;
geomDescNoMotion.boundingBoxBufferOffset = 0;
geomDescNoMotion.boundingBoxCount = int(num_aabbs);
geomDescNoMotion.boundingBoxStride = sizeof(aabb_data[0]);
geomDescNoMotion.intersectionFunctionTableOffset = 2;
/* Force a single any-hit call, so shadow record-all behavior works correctly */
/* (Match optix behavior: unsigned int build_flags =
* OPTIX_GEOMETRY_FLAG_REQUIRE_SINGLE_ANYHIT_CALL;) */
geomDescNoMotion.allowDuplicateIntersectionFunctionInvocation = false;
geomDescNoMotion.opaque = true;
geomDesc = geomDescNoMotion;
}
MTLPrimitiveAccelerationStructureDescriptor *accelDesc =
[MTLPrimitiveAccelerationStructureDescriptor descriptor];
accelDesc.geometryDescriptors = @[ geomDesc ];
if (motion_blur) {
accelDesc.motionStartTime = 0.0f;
accelDesc.motionEndTime = 1.0f;
accelDesc.motionStartBorderMode = MTLMotionBorderModeVanish;
accelDesc.motionEndBorderMode = MTLMotionBorderModeVanish;
accelDesc.motionKeyframeCount = num_motion_steps;
}
if (!use_fast_trace_bvh) {
accelDesc.usage |= (MTLAccelerationStructureUsageRefit |
MTLAccelerationStructureUsagePreferFastBuild);
}
MTLAccelerationStructureSizes accelSizes = [device
accelerationStructureSizesWithDescriptor:accelDesc];
id<MTLAccelerationStructure> accel_uncompressed = [device
newAccelerationStructureWithSize:accelSizes.accelerationStructureSize];
id<MTLBuffer> scratchBuf = [device newBufferWithLength:accelSizes.buildScratchBufferSize
options:MTLResourceStorageModePrivate];
id<MTLBuffer> sizeBuf = [device newBufferWithLength:8 options:MTLResourceStorageModeShared];
id<MTLCommandBuffer> accelCommands = [queue commandBuffer];
id<MTLAccelerationStructureCommandEncoder> accelEnc =
[accelCommands accelerationStructureCommandEncoder];
if (refit) {
[accelEnc refitAccelerationStructure:accel_struct
descriptor:accelDesc
destination:accel_uncompressed
scratchBuffer:scratchBuf
scratchBufferOffset:0];
}
else {
[accelEnc buildAccelerationStructure:accel_uncompressed
descriptor:accelDesc
scratchBuffer:scratchBuf
scratchBufferOffset:0];
}
if (use_fast_trace_bvh) {
[accelEnc writeCompactedAccelerationStructureSize:accel_uncompressed
toBuffer:sizeBuf
offset:0
sizeDataType:MTLDataTypeULong];
}
[accelEnc endEncoding];
[accelCommands addCompletedHandler:^(id<MTLCommandBuffer> command_buffer) {
/* free temp resources */
[scratchBuf release];
[aabbBuf release];
if (use_fast_trace_bvh) {
/* Compact the accel structure */
uint64_t compressed_size = *(uint64_t *)sizeBuf.contents;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
id<MTLCommandBuffer> accelCommands = [queue commandBuffer];
id<MTLAccelerationStructureCommandEncoder> accelEnc =
[accelCommands accelerationStructureCommandEncoder];
id<MTLAccelerationStructure> accel = [device
newAccelerationStructureWithSize:compressed_size];
[accelEnc copyAndCompactAccelerationStructure:accel_uncompressed
toAccelerationStructure:accel];
[accelEnc endEncoding];
[accelCommands addCompletedHandler:^(id<MTLCommandBuffer> command_buffer) {
uint64_t allocated_size = [accel allocatedSize];
stats.mem_alloc(allocated_size);
accel_struct = accel;
[accel_uncompressed release];
accel_struct_building = false;
}];
[accelCommands commit];
});
}
else {
/* set our acceleration structure to the uncompressed structure */
accel_struct = accel_uncompressed;
uint64_t allocated_size = [accel_struct allocatedSize];
stats.mem_alloc(allocated_size);
accel_struct_building = false;
}
[sizeBuf release];
}];
accel_struct_building = true;
[accelCommands commit];
return true;
}
return false;
}
bool BVHMetal::build_BLAS(Progress &progress,
id<MTLDevice> device,
id<MTLCommandQueue> queue,
@@ -491,6 +706,8 @@ bool BVHMetal::build_BLAS(Progress &progress,
return build_BLAS_mesh(progress, device, queue, geom, refit);
case Geometry::HAIR:
return build_BLAS_hair(progress, device, queue, geom, refit);
case Geometry::POINTCLOUD:
return build_BLAS_pointcloud(progress, device, queue, geom, refit);
default:
return false;
}
@@ -544,7 +761,7 @@ bool BVHMetal::build_TLAS(Progress &progress,
num_instances++;
if (ob->use_motion()) {
num_motion_transforms += max(1, ob->get_motion().size());
num_motion_transforms += max((size_t)1, ob->get_motion().size());
}
else {
num_motion_transforms++;

View File

@@ -115,6 +115,8 @@ class MetalDevice : public Device {
void load_texture_info();
void erase_allocation(device_memory &mem);
virtual bool should_use_graphics_interop() override;
virtual unique_ptr<DeviceQueue> gpu_queue_create() override;

View File

@@ -87,17 +87,14 @@ MetalDevice::MetalDevice(const DeviceInfo &info, Stats &stats, Profiler &profile
default:
break;
case METAL_GPU_INTEL: {
use_metalrt = false;
max_threads_per_threadgroup = 64;
break;
}
case METAL_GPU_AMD: {
use_metalrt = false;
max_threads_per_threadgroup = 128;
break;
}
case METAL_GPU_APPLE: {
use_metalrt = true;
max_threads_per_threadgroup = 512;
break;
}
@@ -432,6 +429,25 @@ void MetalDevice::load_texture_info()
}
}
void MetalDevice::erase_allocation(device_memory &mem)
{
stats.mem_free(mem.device_size);
mem.device_pointer = 0;
mem.device_size = 0;
auto it = metal_mem_map.find(&mem);
if (it != metal_mem_map.end()) {
MetalMem *mmem = it->second.get();
/* blank out reference to MetalMem* in the launch params (fixes crash T94736) */
if (mmem->pointer_index >= 0) {
device_ptr *pointers = (device_ptr *)&launch_params;
pointers[mmem->pointer_index] = 0;
}
metal_mem_map.erase(it);
}
}
MetalDevice::MetalMem *MetalDevice::generic_alloc(device_memory &mem)
{
size_t size = mem.memory_size();
@@ -561,11 +577,7 @@ void MetalDevice::generic_free(device_memory &mem)
mmem.mtlBuffer = nil;
}
stats.mem_free(mem.device_size);
mem.device_pointer = 0;
mem.device_size = 0;
metal_mem_map.erase(&mem);
erase_allocation(mem);
}
}
@@ -954,10 +966,7 @@ void MetalDevice::tex_free(device_texture &mem)
delayed_free_list.push_back(mmem.mtlTexture);
mmem.mtlTexture = nil;
}
stats.mem_free(mem.device_size);
mem.device_pointer = 0;
mem.device_size = 0;
metal_mem_map.erase(&mem);
erase_allocation(mem);
}
}

View File

@@ -36,6 +36,8 @@ enum {
METALRT_FUNC_CURVE_RIBBON_SHADOW,
METALRT_FUNC_CURVE_ALL,
METALRT_FUNC_CURVE_ALL_SHADOW,
METALRT_FUNC_POINT,
METALRT_FUNC_POINT_SHADOW,
METALRT_FUNC_NUM
};

View File

@@ -358,6 +358,8 @@ bool MetalDeviceKernels::load(MetalDevice *device, int kernel_type)
"__intersection__curve_ribbon_shadow",
"__intersection__curve_all",
"__intersection__curve_all_shadow",
"__intersection__point",
"__intersection__point_shadow",
};
assert(sizeof(function_names) / sizeof(function_names[0]) == METALRT_FUNC_NUM);
@@ -400,36 +402,50 @@ bool MetalDeviceKernels::load(MetalDevice *device, int kernel_type)
NSArray *function_list = nil;
if (device->use_metalrt) {
id<MTLFunction> box_intersect_default = nil;
id<MTLFunction> box_intersect_shadow = nil;
id<MTLFunction> curve_intersect_default = nil;
id<MTLFunction> curve_intersect_shadow = nil;
id<MTLFunction> point_intersect_default = nil;
id<MTLFunction> point_intersect_shadow = nil;
if (device->kernel_features & KERNEL_FEATURE_HAIR) {
/* Add curve intersection programs. */
if (device->kernel_features & KERNEL_FEATURE_HAIR_THICK) {
/* Slower programs for thick hair since that also slows down ribbons.
* Ideally this should not be needed. */
box_intersect_default = rt_intersection_funcs[kernel_type][METALRT_FUNC_CURVE_ALL];
box_intersect_shadow = rt_intersection_funcs[kernel_type][METALRT_FUNC_CURVE_ALL_SHADOW];
curve_intersect_default = rt_intersection_funcs[kernel_type][METALRT_FUNC_CURVE_ALL];
curve_intersect_shadow =
rt_intersection_funcs[kernel_type][METALRT_FUNC_CURVE_ALL_SHADOW];
}
else {
box_intersect_default = rt_intersection_funcs[kernel_type][METALRT_FUNC_CURVE_RIBBON];
box_intersect_shadow =
curve_intersect_default = rt_intersection_funcs[kernel_type][METALRT_FUNC_CURVE_RIBBON];
curve_intersect_shadow =
rt_intersection_funcs[kernel_type][METALRT_FUNC_CURVE_RIBBON_SHADOW];
}
}
if (device->kernel_features & KERNEL_FEATURE_POINTCLOUD) {
point_intersect_default = rt_intersection_funcs[kernel_type][METALRT_FUNC_POINT];
point_intersect_shadow = rt_intersection_funcs[kernel_type][METALRT_FUNC_POINT_SHADOW];
}
table_functions[METALRT_TABLE_DEFAULT] = [NSArray
arrayWithObjects:rt_intersection_funcs[kernel_type][METALRT_FUNC_DEFAULT_TRI],
box_intersect_default ?
box_intersect_default :
curve_intersect_default ?
curve_intersect_default :
rt_intersection_funcs[kernel_type][METALRT_FUNC_DEFAULT_BOX],
point_intersect_default ?
point_intersect_default :
rt_intersection_funcs[kernel_type][METALRT_FUNC_DEFAULT_BOX],
nil];
table_functions[METALRT_TABLE_SHADOW] = [NSArray
arrayWithObjects:rt_intersection_funcs[kernel_type][METALRT_FUNC_SHADOW_TRI],
box_intersect_shadow ?
box_intersect_shadow :
curve_intersect_shadow ?
curve_intersect_shadow :
rt_intersection_funcs[kernel_type][METALRT_FUNC_SHADOW_BOX],
point_intersect_shadow ?
point_intersect_shadow :
rt_intersection_funcs[kernel_type][METALRT_FUNC_SHADOW_BOX],
nil];
table_functions[METALRT_TABLE_LOCAL] = [NSArray
arrayWithObjects:rt_intersection_funcs[kernel_type][METALRT_FUNC_LOCAL_TRI],
rt_intersection_funcs[kernel_type][METALRT_FUNC_LOCAL_BOX],
rt_intersection_funcs[kernel_type][METALRT_FUNC_LOCAL_BOX],
nil];

View File

@@ -226,7 +226,7 @@ bool OptiXDevice::load_kernels(const uint kernel_features)
pipeline_options.usesMotionBlur = false;
pipeline_options.traversableGraphFlags =
OPTIX_TRAVERSABLE_GRAPH_FLAG_ALLOW_SINGLE_LEVEL_INSTANCING;
pipeline_options.numPayloadValues = 6;
pipeline_options.numPayloadValues = 8;
pipeline_options.numAttributeValues = 2; /* u, v */
pipeline_options.exceptionFlags = OPTIX_EXCEPTION_FLAG_NONE;
pipeline_options.pipelineLaunchParamsVariableName = "__params"; /* See globals.h */
@@ -1586,7 +1586,7 @@ void OptiXDevice::build_bvh(BVH *bvh, Progress &progress, bool refit)
if (ob->is_traceable() && ob->use_motion()) {
total_motion_transform_size = align_up(total_motion_transform_size,
OPTIX_TRANSFORM_BYTE_ALIGNMENT);
const size_t motion_keys = max(ob->get_motion().size(), 2) - 2;
const size_t motion_keys = max(ob->get_motion().size(), (size_t)2) - 2;
total_motion_transform_size = total_motion_transform_size +
sizeof(OptixSRTMotionTransform) +
motion_keys * sizeof(OptixSRTData);
@@ -1660,7 +1660,7 @@ void OptiXDevice::build_bvh(BVH *bvh, Progress &progress, bool refit)
/* Insert motion traversable if object has motion. */
if (motion_blur && ob->use_motion()) {
size_t motion_keys = max(ob->get_motion().size(), 2) - 2;
size_t motion_keys = max(ob->get_motion().size(), (size_t)2) - 2;
size_t motion_transform_size = sizeof(OptixSRTMotionTransform) +
motion_keys * sizeof(OptixSRTData);

View File

@@ -125,20 +125,41 @@ static Device *find_best_device(Device *device, DenoiserType type)
return best_device;
}
static DeviceInfo find_best_denoiser_device_info(const vector<DeviceInfo> &device_infos,
DenoiserType denoiser_type)
{
for (const DeviceInfo &device_info : device_infos) {
if ((device_info.denoisers & denoiser_type) == 0) {
continue;
}
/* TODO(sergey): Use one of the already configured devices, so that OptiX denoising can happen
* on a physical CUDA device which is already used for rendering. */
/* TODO(sergey): Choose fastest device for denoising. */
return device_info;
}
DeviceInfo none_device;
none_device.type = DEVICE_NONE;
return none_device;
}
static unique_ptr<Device> create_denoiser_device(Device *path_trace_device,
const uint device_type_mask)
const uint device_type_mask,
DenoiserType denoiser_type)
{
const vector<DeviceInfo> device_infos = Device::available_devices(device_type_mask);
if (device_infos.empty()) {
return nullptr;
}
/* TODO(sergey): Use one of the already configured devices, so that OptiX denoising can happen on
* a physical CUDA device which is already used for rendering. */
/* TODO(sergey): Choose fastest device for denoising. */
const DeviceInfo denoiser_device_info = device_infos.front();
const DeviceInfo denoiser_device_info = find_best_denoiser_device_info(device_infos,
denoiser_type);
if (denoiser_device_info.type == DEVICE_NONE) {
return nullptr;
}
unique_ptr<Device> denoiser_device(
Device::create(denoiser_device_info, path_trace_device->stats, path_trace_device->profiler));
@@ -186,7 +207,8 @@ Device *Denoiser::ensure_denoiser_device(Progress *progress)
device_creation_attempted_ = true;
const uint device_type_mask = get_device_type_mask();
local_denoiser_device_ = create_denoiser_device(path_trace_device_, device_type_mask);
local_denoiser_device_ = create_denoiser_device(
path_trace_device_, device_type_mask, params_.type);
denoiser_device_ = local_denoiser_device_.get();
return denoiser_device_;

View File

@@ -37,8 +37,6 @@ OIDNDenoiser::OIDNDenoiser(Device *path_trace_device, const DenoiseParams &param
: Denoiser(path_trace_device, params)
{
DCHECK_EQ(params.type, DENOISER_OPENIMAGEDENOISE);
DCHECK(openimagedenoise_supported()) << "OpenImageDenoiser is not supported on this platform.";
}
#ifdef WITH_OPENIMAGEDENOISE
@@ -585,6 +583,9 @@ bool OIDNDenoiser::denoise_buffer(const BufferParams &buffer_params,
const int num_samples,
bool allow_inplace_modification)
{
DCHECK(openimagedenoise_supported())
<< "OpenImageDenoiser is not supported on this platform or build.";
#ifdef WITH_OPENIMAGEDENOISE
thread_scoped_lock lock(mutex_);
@@ -635,4 +636,20 @@ uint OIDNDenoiser::get_device_type_mask() const
return DEVICE_MASK_CPU;
}
Device *OIDNDenoiser::ensure_denoiser_device(Progress *progress)
{
#ifndef WITH_OPENIMAGEDENOISE
path_trace_device_->set_error("Build without OpenImageDenoiser");
return nullptr;
#else
if (!openimagedenoise_supported()) {
path_trace_device_->set_error(
"OpenImageDenoiser is not supported on this CPU: missing SSE 4.1 support");
return nullptr;
}
return Denoiser::ensure_denoiser_device(progress);
#endif
}
CCL_NAMESPACE_END

View File

@@ -38,6 +38,7 @@ class OIDNDenoiser : public Denoiser {
protected:
virtual uint get_device_type_mask() const override;
virtual Device *ensure_denoiser_device(Progress *progress) override;
/* We only perform one denoising at a time, since OpenImageDenoise itself is multithreaded.
* Use this mutex whenever images are passed to the OIDN and needs to be denoised. */

View File

@@ -141,6 +141,7 @@ bool PassAccessor::get_render_tile_pixels(const RenderBuffers *render_buffers,
const PassType type = pass_access_info_.type;
const PassMode mode = pass_access_info_.mode;
const PassInfo pass_info = Pass::get_info(type, pass_access_info_.include_albedo);
int num_written_components = pass_info.num_components;
if (pass_info.num_components == 1) {
/* Single channel passes. */
@@ -188,8 +189,10 @@ bool PassAccessor::get_render_tile_pixels(const RenderBuffers *render_buffers,
else if ((pass_info.divide_type != PASS_NONE || pass_info.direct_type != PASS_NONE ||
pass_info.indirect_type != PASS_NONE) &&
mode != PassMode::DENOISED) {
/* RGB lighting passes that need to divide out color and/or sum direct and indirect. */
/* RGB lighting passes that need to divide out color and/or sum direct and indirect.
* These can also optionally write alpha like the combined pass. */
get_pass_light_path(render_buffers, buffer_params, destination);
num_written_components = 4;
}
else {
/* Passes that need no special computation, or denoised passes that already
@@ -215,7 +218,7 @@ bool PassAccessor::get_render_tile_pixels(const RenderBuffers *render_buffers,
}
}
pad_pixels(buffer_params, destination, pass_info.num_components);
pad_pixels(buffer_params, destination, num_written_components);
return true;
}

View File

@@ -820,8 +820,15 @@ void PathTrace::tile_buffer_read()
return;
}
/* Read buffers back from device. */
tbb::parallel_for_each(path_trace_works_, [&](unique_ptr<PathTraceWork> &path_trace_work) {
path_trace_work->copy_render_buffers_from_device();
});
/* Read (subset of) passes from output driver. */
PathTraceTile tile(*this);
if (output_driver_->read_render_tile(tile)) {
/* Copy buffers to device again. */
tbb::parallel_for_each(path_trace_works_, [](unique_ptr<PathTraceWork> &path_trace_work) {
path_trace_work->copy_render_buffers_to_device();
});

View File

@@ -157,7 +157,7 @@ bool ShaderEval::eval_gpu(Device *device,
queue->init_execution();
/* Execute work on GPU in chunk, so we can cancel.
* TODO : query appropriate size from device.*/
* TODO: query appropriate size from device. */
const int32_t chunk_size = 65536;
device_ptr d_input = input.device_pointer;

View File

@@ -173,15 +173,16 @@ ccl_device_intersect bool scene_intersect(KernelGlobals kg,
uint p3 = 0;
uint p4 = visibility;
uint p5 = PRIMITIVE_NONE;
uint p6 = ((uint64_t)ray) & 0xFFFFFFFF;
uint p7 = (((uint64_t)ray) >> 32) & 0xFFFFFFFF;
uint ray_mask = visibility & 0xFF;
uint ray_flags = OPTIX_RAY_FLAG_NONE;
uint ray_flags = OPTIX_RAY_FLAG_ENFORCE_ANYHIT;
if (0 == ray_mask && (visibility & ~0xFF) != 0) {
ray_mask = 0xFF;
ray_flags = OPTIX_RAY_FLAG_ENFORCE_ANYHIT;
}
else if (visibility & PATH_RAY_SHADOW_OPAQUE) {
ray_flags = OPTIX_RAY_FLAG_TERMINATE_ON_FIRST_HIT;
ray_flags |= OPTIX_RAY_FLAG_TERMINATE_ON_FIRST_HIT;
}
optixTrace(scene_intersect_valid(ray) ? kernel_data.bvh.scene : 0,
@@ -200,7 +201,9 @@ ccl_device_intersect bool scene_intersect(KernelGlobals kg,
p2,
p3,
p4,
p5);
p5,
p6,
p7);
isect->t = __uint_as_float(p0);
isect->u = __uint_as_float(p1);
@@ -242,6 +245,7 @@ ccl_device_intersect bool scene_intersect(KernelGlobals kg,
}
MetalRTIntersectionPayload payload;
payload.self = ray->self;
payload.u = 0.0f;
payload.v = 0.0f;
payload.visibility = visibility;
@@ -309,6 +313,7 @@ ccl_device_intersect bool scene_intersect(KernelGlobals kg,
CCLIntersectContext ctx(kg, CCLIntersectContext::RAY_REGULAR);
IntersectContext rtc_ctx(&ctx);
RTCRayHit ray_hit;
ctx.ray = ray;
kernel_embree_setup_rayhit(*ray, ray_hit, visibility);
rtcIntersect1(kernel_data.bvh.scene, &rtc_ctx.context, &ray_hit);
if (ray_hit.hit.geomID != RTC_INVALID_GEOMETRY_ID &&
@@ -356,6 +361,9 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals kg,
uint p2 = pointer_pack_to_uint_0(local_isect);
uint p3 = pointer_pack_to_uint_1(local_isect);
uint p4 = local_object;
uint p6 = ((uint64_t)ray) & 0xFFFFFFFF;
uint p7 = (((uint64_t)ray) >> 32) & 0xFFFFFFFF;
/* Is set to zero on miss or if ray is aborted, so can be used as return value. */
uint p5 = max_hits;
@@ -379,7 +387,9 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals kg,
p2,
p3,
p4,
p5);
p5,
p6,
p7);
return p5;
# elif defined(__METALRT__)
@@ -417,6 +427,7 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals kg,
}
MetalRTIntersectionLocalPayload payload;
payload.self = ray->self;
payload.local_object = local_object;
payload.max_hits = max_hits;
payload.local_isect.num_hits = 0;
@@ -460,6 +471,7 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals kg,
kg, has_bvh ? CCLIntersectContext::RAY_SSS : CCLIntersectContext::RAY_LOCAL);
ctx.lcg_state = lcg_state;
ctx.max_hits = max_hits;
ctx.ray = ray;
ctx.local_isect = local_isect;
if (local_isect) {
local_isect->num_hits = 0;
@@ -532,6 +544,8 @@ ccl_device_intersect bool scene_intersect_shadow_all(KernelGlobals kg,
uint p3 = max_hits;
uint p4 = visibility;
uint p5 = false;
uint p6 = ((uint64_t)ray) & 0xFFFFFFFF;
uint p7 = (((uint64_t)ray) >> 32) & 0xFFFFFFFF;
uint ray_mask = visibility & 0xFF;
if (0 == ray_mask && (visibility & ~0xFF) != 0) {
@@ -555,7 +569,9 @@ ccl_device_intersect bool scene_intersect_shadow_all(KernelGlobals kg,
p2,
p3,
p4,
p5);
p5,
p6,
p7);
*num_recorded_hits = uint16_unpack_from_uint_0(p2);
*throughput = __uint_as_float(p1);
@@ -588,6 +604,7 @@ ccl_device_intersect bool scene_intersect_shadow_all(KernelGlobals kg,
}
MetalRTIntersectionShadowPayload payload;
payload.self = ray->self;
payload.visibility = visibility;
payload.max_hits = max_hits;
payload.num_hits = 0;
@@ -634,6 +651,7 @@ ccl_device_intersect bool scene_intersect_shadow_all(KernelGlobals kg,
Intersection *isect_array = (Intersection *)state->shadow_isect;
ctx.isect_s = isect_array;
ctx.max_hits = max_hits;
ctx.ray = ray;
IntersectContext rtc_ctx(&ctx);
RTCRay rtc_ray;
kernel_embree_setup_ray(*ray, rtc_ray, visibility);
@@ -685,6 +703,8 @@ ccl_device_intersect bool scene_intersect_volume(KernelGlobals kg,
uint p3 = 0;
uint p4 = visibility;
uint p5 = PRIMITIVE_NONE;
uint p6 = ((uint64_t)ray) & 0xFFFFFFFF;
uint p7 = (((uint64_t)ray) >> 32) & 0xFFFFFFFF;
uint ray_mask = visibility & 0xFF;
if (0 == ray_mask && (visibility & ~0xFF) != 0) {
@@ -708,7 +728,9 @@ ccl_device_intersect bool scene_intersect_volume(KernelGlobals kg,
p2,
p3,
p4,
p5);
p5,
p6,
p7);
isect->t = __uint_as_float(p0);
isect->u = __uint_as_float(p1);
@@ -744,6 +766,7 @@ ccl_device_intersect bool scene_intersect_volume(KernelGlobals kg,
}
MetalRTIntersectionPayload payload;
payload.self = ray->self;
payload.visibility = visibility;
typename metalrt_intersector_type::result_type intersection;
@@ -820,6 +843,7 @@ ccl_device_intersect uint scene_intersect_volume_all(KernelGlobals kg,
ctx.isect_s = isect;
ctx.max_hits = max_hits;
ctx.num_hits = 0;
ctx.ray = ray;
IntersectContext rtc_ctx(&ctx);
RTCRay rtc_ray;
kernel_embree_setup_ray(*ray, rtc_ray, visibility);

View File

@@ -22,6 +22,8 @@
#include "kernel/device/cpu/compat.h"
#include "kernel/device/cpu/globals.h"
#include "kernel/bvh/util.h"
#include "util/vector.h"
CCL_NAMESPACE_BEGIN
@@ -38,6 +40,9 @@ struct CCLIntersectContext {
KernelGlobals kg;
RayType type;
/* For avoiding self intersections */
const Ray *ray;
/* for shadow rays */
Intersection *isect_s;
uint max_hits;
@@ -56,6 +61,7 @@ struct CCLIntersectContext {
{
kg = kg_;
type = type_;
ray = NULL;
max_hits = 1;
num_hits = 0;
num_recorded_hits = 0;
@@ -102,7 +108,34 @@ ccl_device_inline void kernel_embree_setup_rayhit(const Ray &ray,
{
kernel_embree_setup_ray(ray, rayhit.ray, visibility);
rayhit.hit.geomID = RTC_INVALID_GEOMETRY_ID;
rayhit.hit.primID = RTC_INVALID_GEOMETRY_ID;
rayhit.hit.instID[0] = RTC_INVALID_GEOMETRY_ID;
}
ccl_device_inline bool kernel_embree_is_self_intersection(const KernelGlobals kg,
const RTCHit *hit,
const Ray *ray)
{
bool status = false;
if (hit->instID[0] != RTC_INVALID_GEOMETRY_ID) {
const int oID = hit->instID[0] / 2;
if ((ray->self.object == oID) || (ray->self.light_object == oID)) {
RTCScene inst_scene = (RTCScene)rtcGetGeometryUserData(
rtcGetGeometry(kernel_data.bvh.scene, hit->instID[0]));
const int pID = hit->primID +
(intptr_t)rtcGetGeometryUserData(rtcGetGeometry(inst_scene, hit->geomID));
status = intersection_skip_self_shadow(ray->self, oID, pID);
}
}
else {
const int oID = hit->geomID / 2;
if ((ray->self.object == oID) || (ray->self.light_object == oID)) {
const int pID = hit->primID + (intptr_t)rtcGetGeometryUserData(
rtcGetGeometry(kernel_data.bvh.scene, hit->geomID));
status = intersection_skip_self_shadow(ray->self, oID, pID);
}
}
return status;
}
ccl_device_inline void kernel_embree_convert_hit(KernelGlobals kg,

View File

@@ -148,12 +148,27 @@ ccl_device_inline
/* intersect ray against primitive */
for (; prim_addr < prim_addr2; prim_addr++) {
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
/* Only intersect with matching object, for instanced objects we
* already know we are only intersecting the right object. */
if (object == OBJECT_NONE) {
if (kernel_tex_fetch(__prim_object, prim_addr) != local_object) {
continue;
}
}
/* Skip self intersection. */
const int prim = kernel_tex_fetch(__prim_index, prim_addr);
if (intersection_skip_self_local(ray->self, prim)) {
continue;
}
if (triangle_intersect_local(kg,
local_isect,
P,
dir,
object,
local_object,
prim,
prim_addr,
isect_t,
lcg_state,
@@ -168,13 +183,28 @@ ccl_device_inline
/* intersect ray against primitive */
for (; prim_addr < prim_addr2; prim_addr++) {
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
/* Only intersect with matching object, for instanced objects we
* already know we are only intersecting the right object. */
if (object == OBJECT_NONE) {
if (kernel_tex_fetch(__prim_object, prim_addr) != local_object) {
continue;
}
}
/* Skip self intersection. */
const int prim = kernel_tex_fetch(__prim_index, prim_addr);
if (intersection_skip_self_local(ray->self, prim)) {
continue;
}
if (motion_triangle_intersect_local(kg,
local_isect,
P,
dir,
ray->time,
object,
local_object,
prim,
prim_addr,
isect_t,
lcg_state,

View File

@@ -15,6 +15,7 @@
*/
struct MetalRTIntersectionPayload {
RaySelfPrimitives self;
uint visibility;
float u, v;
int prim;
@@ -25,6 +26,7 @@ struct MetalRTIntersectionPayload {
};
struct MetalRTIntersectionLocalPayload {
RaySelfPrimitives self;
uint local_object;
uint lcg_state;
short max_hits;
@@ -34,6 +36,7 @@ struct MetalRTIntersectionLocalPayload {
};
struct MetalRTIntersectionShadowPayload {
RaySelfPrimitives self;
uint visibility;
#if defined(__METALRT_MOTION__)
float time;

View File

@@ -146,7 +146,7 @@ ccl_device_inline
--stack_ptr;
/* primitive intersection */
while (prim_addr < prim_addr2) {
for (; prim_addr < prim_addr2; prim_addr++) {
kernel_assert((kernel_tex_fetch(__prim_type, prim_addr) & PRIMITIVE_ALL) ==
(type & PRIMITIVE_ALL));
bool hit;
@@ -156,16 +156,32 @@ ccl_device_inline
* might give a few % performance improvement */
Intersection isect ccl_optional_struct_init;
const int prim_object = (object == OBJECT_NONE) ?
kernel_tex_fetch(__prim_object, prim_addr) :
object;
const int prim = kernel_tex_fetch(__prim_index, prim_addr);
if (intersection_skip_self_shadow(ray->self, prim_object, prim)) {
continue;
}
switch (type & PRIMITIVE_ALL) {
case PRIMITIVE_TRIANGLE: {
hit = triangle_intersect(
kg, &isect, P, dir, t_max_current, visibility, object, prim_addr);
kg, &isect, P, dir, t_max_current, visibility, prim_object, prim, prim_addr);
break;
}
#if BVH_FEATURE(BVH_MOTION)
case PRIMITIVE_MOTION_TRIANGLE: {
hit = motion_triangle_intersect(
kg, &isect, P, dir, t_max_current, ray->time, visibility, object, prim_addr);
hit = motion_triangle_intersect(kg,
&isect,
P,
dir,
t_max_current,
ray->time,
visibility,
prim_object,
prim,
prim_addr);
break;
}
#endif
@@ -182,20 +198,9 @@ ccl_device_inline
}
}
const int curve_object = (object == OBJECT_NONE) ?
kernel_tex_fetch(__prim_object, prim_addr) :
object;
const int curve_type = kernel_tex_fetch(__prim_type, prim_addr);
const int curve_prim = kernel_tex_fetch(__prim_index, prim_addr);
hit = curve_intersect(kg,
&isect,
P,
dir,
t_max_current,
curve_object,
curve_prim,
ray->time,
curve_type);
hit = curve_intersect(
kg, &isect, P, dir, t_max_current, prim_object, prim, ray->time, curve_type);
break;
}
@@ -211,20 +216,9 @@ ccl_device_inline
}
}
const int point_object = (object == OBJECT_NONE) ?
kernel_tex_fetch(__prim_object, prim_addr) :
object;
const int point_prim = kernel_tex_fetch(__prim_index, prim_addr);
const int point_type = kernel_tex_fetch(__prim_type, prim_addr);
hit = point_intersect(kg,
&isect,
P,
dir,
t_max_current,
point_object,
point_prim,
ray->time,
point_type);
hit = point_intersect(
kg, &isect, P, dir, t_max_current, prim_object, prim, ray->time, point_type);
break;
}
#endif /* BVH_FEATURE(BVH_POINTCLOUD) */
@@ -301,8 +295,6 @@ ccl_device_inline
integrator_state_write_shadow_isect(state, &isect, record_index);
}
}
prim_addr++;
}
}
else {

View File

@@ -133,89 +133,91 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals kg,
--stack_ptr;
/* primitive intersection */
switch (type & PRIMITIVE_ALL) {
case PRIMITIVE_TRIANGLE: {
for (; prim_addr < prim_addr2; prim_addr++) {
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
for (; prim_addr < prim_addr2; prim_addr++) {
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
const int prim_object = (object == OBJECT_NONE) ?
kernel_tex_fetch(__prim_object, prim_addr) :
object;
const int prim = kernel_tex_fetch(__prim_index, prim_addr);
if (intersection_skip_self_shadow(ray->self, prim_object, prim)) {
continue;
}
switch (type & PRIMITIVE_ALL) {
case PRIMITIVE_TRIANGLE: {
if (triangle_intersect(
kg, isect, P, dir, isect->t, visibility, object, prim_addr)) {
kg, isect, P, dir, isect->t, visibility, prim_object, prim, prim_addr)) {
/* shadow ray early termination */
if (visibility & PATH_RAY_SHADOW_OPAQUE)
return true;
}
break;
}
break;
}
#if BVH_FEATURE(BVH_MOTION)
case PRIMITIVE_MOTION_TRIANGLE: {
for (; prim_addr < prim_addr2; prim_addr++) {
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
if (motion_triangle_intersect(
kg, isect, P, dir, isect->t, ray->time, visibility, object, prim_addr)) {
case PRIMITIVE_MOTION_TRIANGLE: {
if (motion_triangle_intersect(kg,
isect,
P,
dir,
isect->t,
ray->time,
visibility,
prim_object,
prim,
prim_addr)) {
/* shadow ray early termination */
if (visibility & PATH_RAY_SHADOW_OPAQUE)
return true;
}
break;
}
break;
}
#endif /* BVH_FEATURE(BVH_MOTION) */
#if BVH_FEATURE(BVH_HAIR)
case PRIMITIVE_CURVE_THICK:
case PRIMITIVE_MOTION_CURVE_THICK:
case PRIMITIVE_CURVE_RIBBON:
case PRIMITIVE_MOTION_CURVE_RIBBON: {
for (; prim_addr < prim_addr2; prim_addr++) {
case PRIMITIVE_CURVE_THICK:
case PRIMITIVE_MOTION_CURVE_THICK:
case PRIMITIVE_CURVE_RIBBON:
case PRIMITIVE_MOTION_CURVE_RIBBON: {
if ((type & PRIMITIVE_MOTION) && kernel_data.bvh.use_bvh_steps) {
const float2 prim_time = kernel_tex_fetch(__prim_time, prim_addr);
if (ray->time < prim_time.x || ray->time > prim_time.y) {
continue;
break;
}
}
const int curve_object = (object == OBJECT_NONE) ?
kernel_tex_fetch(__prim_object, prim_addr) :
object;
const int curve_prim = kernel_tex_fetch(__prim_index, prim_addr);
const int curve_type = kernel_tex_fetch(__prim_type, prim_addr);
const bool hit = curve_intersect(
kg, isect, P, dir, isect->t, curve_object, curve_prim, ray->time, curve_type);
kg, isect, P, dir, isect->t, prim_object, prim, ray->time, curve_type);
if (hit) {
/* shadow ray early termination */
if (visibility & PATH_RAY_SHADOW_OPAQUE)
return true;
}
break;
}
break;
}
#endif /* BVH_FEATURE(BVH_HAIR) */
#if BVH_FEATURE(BVH_POINTCLOUD)
case PRIMITIVE_POINT:
case PRIMITIVE_MOTION_POINT: {
for (; prim_addr < prim_addr2; prim_addr++) {
case PRIMITIVE_POINT:
case PRIMITIVE_MOTION_POINT: {
if ((type & PRIMITIVE_MOTION) && kernel_data.bvh.use_bvh_steps) {
const float2 prim_time = kernel_tex_fetch(__prim_time, prim_addr);
if (ray->time < prim_time.x || ray->time > prim_time.y) {
continue;
break;
}
}
const int point_object = (object == OBJECT_NONE) ?
kernel_tex_fetch(__prim_object, prim_addr) :
object;
const int point_prim = kernel_tex_fetch(__prim_index, prim_addr);
const int point_type = kernel_tex_fetch(__prim_type, prim_addr);
const bool hit = point_intersect(
kg, isect, P, dir, isect->t, point_object, point_prim, ray->time, point_type);
kg, isect, P, dir, isect->t, prim_object, prim, ray->time, point_type);
if (hit) {
/* shadow ray early termination */
if (visibility & PATH_RAY_SHADOW_OPAQUE)
return true;
}
break;
}
break;
}
#endif /* BVH_FEATURE(BVH_POINTCLOUD) */
}
}
}
else {

View File

@@ -21,54 +21,22 @@ CCL_NAMESPACE_BEGIN
/* Ray offset to avoid self intersection.
*
* This function should be used to compute a modified ray start position for
* rays leaving from a surface. */
* rays leaving from a surface. This is from "A Fast and Robust Method for Avoiding
* Self-Intersection" see https://research.nvidia.com/publication/2019-03_A-Fast-and
*/
ccl_device_inline float3 ray_offset(float3 P, float3 Ng)
{
#ifdef __INTERSECTION_REFINE__
const float epsilon_f = 1e-5f;
/* ideally this should match epsilon_f, but instancing and motion blur
* precision makes it problematic */
const float epsilon_test = 1.0f;
const int epsilon_i = 32;
const float int_scale = 256.0f;
int3 of_i = make_int3((int)(int_scale * Ng.x), (int)(int_scale * Ng.y), (int)(int_scale * Ng.z));
float3 res;
/* x component */
if (fabsf(P.x) < epsilon_test) {
res.x = P.x + Ng.x * epsilon_f;
}
else {
uint ix = __float_as_uint(P.x);
ix += ((ix ^ __float_as_uint(Ng.x)) >> 31) ? -epsilon_i : epsilon_i;
res.x = __uint_as_float(ix);
}
/* y component */
if (fabsf(P.y) < epsilon_test) {
res.y = P.y + Ng.y * epsilon_f;
}
else {
uint iy = __float_as_uint(P.y);
iy += ((iy ^ __float_as_uint(Ng.y)) >> 31) ? -epsilon_i : epsilon_i;
res.y = __uint_as_float(iy);
}
/* z component */
if (fabsf(P.z) < epsilon_test) {
res.z = P.z + Ng.z * epsilon_f;
}
else {
uint iz = __float_as_uint(P.z);
iz += ((iz ^ __float_as_uint(Ng.z)) >> 31) ? -epsilon_i : epsilon_i;
res.z = __uint_as_float(iz);
}
return res;
#else
const float epsilon_f = 1e-4f;
return P + epsilon_f * Ng;
#endif
float3 p_i = make_float3(__int_as_float(__float_as_int(P.x) + ((P.x < 0) ? -of_i.x : of_i.x)),
__int_as_float(__float_as_int(P.y) + ((P.y < 0) ? -of_i.y : of_i.y)),
__int_as_float(__float_as_int(P.z) + ((P.z < 0) ? -of_i.z : of_i.z)));
const float origin = 1.0f / 32.0f;
const float float_scale = 1.0f / 65536.0f;
return make_float3(fabsf(P.x) < origin ? P.x + float_scale * Ng.x : p_i.x,
fabsf(P.y) < origin ? P.y + float_scale * Ng.y : p_i.y,
fabsf(P.z) < origin ? P.z + float_scale * Ng.z : p_i.z);
}
#if defined(__KERNEL_CPU__)
@@ -227,4 +195,25 @@ ccl_device_inline float intersection_curve_shadow_transparency(KernelGlobals kg,
return (1.0f - u) * f0 + u * f1;
}
ccl_device_inline bool intersection_skip_self(ccl_private const RaySelfPrimitives &self,
const int object,
const int prim)
{
return (self.prim == prim) && (self.object == object);
}
ccl_device_inline bool intersection_skip_self_shadow(ccl_private const RaySelfPrimitives &self,
const int object,
const int prim)
{
return ((self.prim == prim) && (self.object == object)) ||
((self.light_prim == prim) && (self.light_object == object));
}
ccl_device_inline bool intersection_skip_self_local(ccl_private const RaySelfPrimitives &self,
const int prim)
{
return (self.prim == prim);
}
CCL_NAMESPACE_END

View File

@@ -140,14 +140,20 @@ ccl_device_inline
for (; prim_addr < prim_addr2; prim_addr++) {
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
/* only primitives from volume object */
uint tri_object = (object == OBJECT_NONE) ?
kernel_tex_fetch(__prim_object, prim_addr) :
object;
int object_flag = kernel_tex_fetch(__object_flag, tri_object);
const int prim_object = (object == OBJECT_NONE) ?
kernel_tex_fetch(__prim_object, prim_addr) :
object;
const int prim = kernel_tex_fetch(__prim_index, prim_addr);
if (intersection_skip_self(ray->self, prim_object, prim)) {
continue;
}
int object_flag = kernel_tex_fetch(__object_flag, prim_object);
if ((object_flag & SD_OBJECT_HAS_VOLUME) == 0) {
continue;
}
triangle_intersect(kg, isect, P, dir, isect->t, visibility, object, prim_addr);
triangle_intersect(
kg, isect, P, dir, isect->t, visibility, prim_object, prim, prim_addr);
}
break;
}
@@ -157,15 +163,27 @@ ccl_device_inline
for (; prim_addr < prim_addr2; prim_addr++) {
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
/* only primitives from volume object */
uint tri_object = (object == OBJECT_NONE) ?
kernel_tex_fetch(__prim_object, prim_addr) :
object;
int object_flag = kernel_tex_fetch(__object_flag, tri_object);
const int prim_object = (object == OBJECT_NONE) ?
kernel_tex_fetch(__prim_object, prim_addr) :
object;
const int prim = kernel_tex_fetch(__prim_index, prim_addr);
if (intersection_skip_self(ray->self, prim_object, prim)) {
continue;
}
int object_flag = kernel_tex_fetch(__object_flag, prim_object);
if ((object_flag & SD_OBJECT_HAS_VOLUME) == 0) {
continue;
}
motion_triangle_intersect(
kg, isect, P, dir, isect->t, ray->time, visibility, object, prim_addr);
motion_triangle_intersect(kg,
isect,
P,
dir,
isect->t,
ray->time,
visibility,
prim_object,
prim,
prim_addr);
}
break;
}

View File

@@ -143,15 +143,19 @@ ccl_device_inline
for (; prim_addr < prim_addr2; prim_addr++) {
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
/* only primitives from volume object */
uint tri_object = (object == OBJECT_NONE) ?
kernel_tex_fetch(__prim_object, prim_addr) :
object;
int object_flag = kernel_tex_fetch(__object_flag, tri_object);
const int prim_object = (object == OBJECT_NONE) ?
kernel_tex_fetch(__prim_object, prim_addr) :
object;
const int prim = kernel_tex_fetch(__prim_index, prim_addr);
if (intersection_skip_self(ray->self, prim_object, prim)) {
continue;
}
int object_flag = kernel_tex_fetch(__object_flag, prim_object);
if ((object_flag & SD_OBJECT_HAS_VOLUME) == 0) {
continue;
}
hit = triangle_intersect(
kg, isect_array, P, dir, isect_t, visibility, object, prim_addr);
kg, isect_array, P, dir, isect_t, visibility, prim_object, prim, prim_addr);
if (hit) {
/* Move on to next entry in intersections array. */
isect_array++;
@@ -183,15 +187,27 @@ ccl_device_inline
for (; prim_addr < prim_addr2; prim_addr++) {
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
/* only primitives from volume object */
uint tri_object = (object == OBJECT_NONE) ?
kernel_tex_fetch(__prim_object, prim_addr) :
object;
int object_flag = kernel_tex_fetch(__object_flag, tri_object);
const int prim_object = (object == OBJECT_NONE) ?
kernel_tex_fetch(__prim_object, prim_addr) :
object;
const int prim = kernel_tex_fetch(__prim_index, prim_addr);
if (intersection_skip_self(ray->self, prim_object, prim)) {
continue;
}
int object_flag = kernel_tex_fetch(__object_flag, prim_object);
if ((object_flag & SD_OBJECT_HAS_VOLUME) == 0) {
continue;
}
hit = motion_triangle_intersect(
kg, isect_array, P, dir, isect_t, ray->time, visibility, object, prim_addr);
hit = motion_triangle_intersect(kg,
isect_array,
P,
dir,
isect_t,
ray->time,
visibility,
prim_object,
prim,
prim_addr);
if (hit) {
/* Move on to next entry in intersections array. */
isect_array++;

View File

@@ -199,22 +199,18 @@ ccl_device int volume_sample_channel(float3 albedo,
* Tracing". Matt Jen-Yuan Chiang, Peter Kutz, Brent Burley. SIGGRAPH 2016. */
float3 weights = fabs(throughput * albedo);
float sum_weights = weights.x + weights.y + weights.z;
float3 weights_pdf;
if (sum_weights > 0.0f) {
weights_pdf = weights / sum_weights;
*pdf = weights / sum_weights;
}
else {
weights_pdf = make_float3(1.0f / 3.0f, 1.0f / 3.0f, 1.0f / 3.0f);
*pdf = make_float3(1.0f / 3.0f, 1.0f / 3.0f, 1.0f / 3.0f);
}
*pdf = weights_pdf;
/* OpenCL does not support -> on float3, so don't use pdf->x. */
if (rand < weights_pdf.x) {
if (rand < pdf->x) {
return 0;
}
else if (rand < weights_pdf.x + weights_pdf.y) {
else if (rand < pdf->x + pdf->y) {
return 1;
}
else {

View File

@@ -243,6 +243,10 @@ ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
}
}
#ifdef __KERNEL_METAL__
constant int __dummy_constant [[function_constant(0)]];
#endif
ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
ccl_gpu_kernel_signature(integrator_shade_surface_raytrace,
ccl_global const int *path_index_array,
@@ -253,7 +257,16 @@ ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
if (global_index < work_size) {
const int state = (path_index_array) ? path_index_array[global_index] : global_index;
#ifdef __KERNEL_METAL__
KernelGlobals kg = NULL;
/* Workaround Ambient Occlusion and Bevel nodes not working with Metal.
* Dummy offset should not affect result, but somehow fixes bug! */
kg += __dummy_constant;
ccl_gpu_kernel_call(integrator_shade_surface_raytrace(kg, state, render_buffer));
#else
ccl_gpu_kernel_call(integrator_shade_surface_raytrace(NULL, state, render_buffer));
#endif
}
}

View File

@@ -40,6 +40,27 @@ struct TriangleIntersectionResult
enum { METALRT_HIT_TRIANGLE, METALRT_HIT_BOUNDING_BOX };
ccl_device_inline bool intersection_skip_self(ray_data const RaySelfPrimitives& self,
const int object,
const int prim)
{
return (self.prim == prim) && (self.object == object);
}
ccl_device_inline bool intersection_skip_self_shadow(ray_data const RaySelfPrimitives& self,
const int object,
const int prim)
{
return ((self.prim == prim) && (self.object == object)) ||
((self.light_prim == prim) && (self.light_object == object));
}
ccl_device_inline bool intersection_skip_self_local(ray_data const RaySelfPrimitives& self,
const int prim)
{
return (self.prim == prim);
}
template<typename TReturn, uint intersection_type>
TReturn metalrt_local_hit(constant KernelParamsMetal &launch_params_metal,
ray_data MetalKernelContext::MetalRTIntersectionLocalPayload &payload,
@@ -53,8 +74,8 @@ TReturn metalrt_local_hit(constant KernelParamsMetal &launch_params_metal,
#ifdef __BVH_LOCAL__
uint prim = primitive_id + kernel_tex_fetch(__object_prim_offset, object);
if (object != payload.local_object) {
/* Only intersect with matching object */
if ((object != payload.local_object) || intersection_skip_self_local(payload.self, prim)) {
/* Only intersect with matching object and skip self-intersecton. */
result.accept = false;
result.continue_search = true;
return result;
@@ -166,6 +187,11 @@ bool metalrt_shadow_all_hit(constant KernelParamsMetal &launch_params_metal,
}
# endif
if (intersection_skip_self_shadow(payload.self, object, prim)) {
/* continue search */
return true;
}
float u = 0.0f, v = 0.0f;
int type = 0;
if (intersection_type == METALRT_HIT_TRIANGLE) {
@@ -322,21 +348,35 @@ inline TReturnType metalrt_visibility_test(constant KernelParamsMetal &launch_pa
}
# endif
# ifdef __VISIBILITY_FLAG__
uint visibility = payload.visibility;
# ifdef __VISIBILITY_FLAG__
if ((kernel_tex_fetch(__objects, object).visibility & visibility) == 0) {
result.accept = false;
result.continue_search = true;
return result;
}
# endif
/* Shadow ray early termination. */
if (visibility & PATH_RAY_SHADOW_OPAQUE) {
result.accept = true;
result.continue_search = false;
return result;
if (intersection_skip_self_shadow(payload.self, object, prim)) {
result.accept = false;
result.continue_search = true;
return result;
}
else {
result.accept = true;
result.continue_search = false;
return result;
}
}
else {
if (intersection_skip_self(payload.self, object, prim)) {
result.accept = false;
result.continue_search = true;
return result;
}
}
# endif
result.accept = true;
result.continue_search = true;
@@ -576,6 +616,150 @@ __intersection__curve_all_shadow(constant KernelParamsMetal &launch_params_metal
return result;
}
#endif /* __HAIR__ */
#ifdef __POINTCLOUD__
ccl_device_inline
void metalrt_intersection_point(constant KernelParamsMetal &launch_params_metal,
ray_data MetalKernelContext::MetalRTIntersectionPayload &payload,
const uint object,
const uint prim,
const uint type,
const float3 ray_origin,
const float3 ray_direction,
float time,
const float ray_tmax,
thread BoundingBoxIntersectionResult &result)
{
# ifdef __VISIBILITY_FLAG__
const uint visibility = payload.visibility;
if ((kernel_tex_fetch(__objects, object).visibility & visibility) == 0) {
return;
}
# endif
float3 P = ray_origin;
float3 dir = ray_direction;
/* The direction is not normalized by default, but the point intersection routine expects that */
float len;
dir = normalize_len(dir, &len);
Intersection isect;
isect.t = ray_tmax;
/* Transform maximum distance into object space. */
if (isect.t != FLT_MAX)
isect.t *= len;
MetalKernelContext context(launch_params_metal);
if (context.point_intersect(NULL, &isect, P, dir, isect.t, object, prim, time, type)) {
result = metalrt_visibility_test<BoundingBoxIntersectionResult, METALRT_HIT_BOUNDING_BOX>(
launch_params_metal, payload, object, prim, isect.u);
if (result.accept) {
result.distance = isect.t / len;
payload.u = isect.u;
payload.v = isect.v;
payload.prim = prim;
payload.type = type;
}
}
}
ccl_device_inline
void metalrt_intersection_point_shadow(constant KernelParamsMetal &launch_params_metal,
ray_data MetalKernelContext::MetalRTIntersectionShadowPayload &payload,
const uint object,
const uint prim,
const uint type,
const float3 ray_origin,
const float3 ray_direction,
float time,
const float ray_tmax,
thread BoundingBoxIntersectionResult &result)
{
const uint visibility = payload.visibility;
float3 P = ray_origin;
float3 dir = ray_direction;
/* The direction is not normalized by default, but the point intersection routine expects that */
float len;
dir = normalize_len(dir, &len);
Intersection isect;
isect.t = ray_tmax;
/* Transform maximum distance into object space */
if (isect.t != FLT_MAX)
isect.t *= len;
MetalKernelContext context(launch_params_metal);
if (context.point_intersect(NULL, &isect, P, dir, isect.t, object, prim, time, type)) {
result.continue_search = metalrt_shadow_all_hit<METALRT_HIT_BOUNDING_BOX>(
launch_params_metal, payload, object, prim, float2(isect.u, isect.v), ray_tmax);
result.accept = !result.continue_search;
if (result.accept) {
result.distance = isect.t / len;
}
}
}
[[intersection(bounding_box, triangle_data, METALRT_TAGS)]]
BoundingBoxIntersectionResult
__intersection__point(constant KernelParamsMetal &launch_params_metal [[buffer(1)]],
ray_data MetalKernelContext::MetalRTIntersectionPayload &payload [[payload]],
const uint object [[user_instance_id]],
const uint primitive_id [[primitive_id]],
const float3 ray_origin [[origin]],
const float3 ray_direction [[direction]],
const float ray_tmax [[max_distance]])
{
const uint prim = primitive_id + kernel_tex_fetch(__object_prim_offset, object);
const int type = kernel_tex_fetch(__objects, object).primitive_type;
BoundingBoxIntersectionResult result;
result.accept = false;
result.continue_search = true;
result.distance = ray_tmax;
metalrt_intersection_point(launch_params_metal, payload, object, prim, type, ray_origin, ray_direction,
# if defined(__METALRT_MOTION__)
payload.time,
# else
0.0f,
# endif
ray_tmax, result);
return result;
}
[[intersection(bounding_box, triangle_data, METALRT_TAGS)]]
BoundingBoxIntersectionResult
__intersection__point_shadow(constant KernelParamsMetal &launch_params_metal [[buffer(1)]],
ray_data MetalKernelContext::MetalRTIntersectionShadowPayload &payload [[payload]],
const uint object [[user_instance_id]],
const uint primitive_id [[primitive_id]],
const float3 ray_origin [[origin]],
const float3 ray_direction [[direction]],
const float ray_tmax [[max_distance]])
{
const uint prim = primitive_id + kernel_tex_fetch(__object_prim_offset, object);
const int type = kernel_tex_fetch(__objects, object).primitive_type;
BoundingBoxIntersectionResult result;
result.accept = false;
result.continue_search = true;
result.distance = ray_tmax;
metalrt_intersection_point_shadow(launch_params_metal, payload, object, prim, type, ray_origin, ray_direction,
# if defined(__METALRT_MOTION__)
payload.time,
# else
0.0f,
# endif
ray_tmax, result);
return result;
}
#endif /* __POINTCLOUD__ */
#endif /* __METALRT__ */

View File

@@ -45,6 +45,11 @@ template<typename T> ccl_device_forceinline T *get_payload_ptr_2()
return pointer_unpack_from_uint<T>(optixGetPayload_2(), optixGetPayload_3());
}
template<typename T> ccl_device_forceinline T *get_payload_ptr_6()
{
return (T *)(((uint64_t)optixGetPayload_7() << 32) | optixGetPayload_6());
}
ccl_device_forceinline int get_object_id()
{
#ifdef __OBJECT_MOTION__
@@ -111,6 +116,12 @@ extern "C" __global__ void __anyhit__kernel_optix_local_hit()
return optixIgnoreIntersection();
}
const int prim = optixGetPrimitiveIndex();
ccl_private Ray *const ray = get_payload_ptr_6<Ray>();
if (intersection_skip_self_local(ray->self, prim)) {
return optixIgnoreIntersection();
}
const uint max_hits = optixGetPayload_5();
if (max_hits == 0) {
/* Special case for when no hit information is requested, just report that something was hit */
@@ -149,8 +160,6 @@ extern "C" __global__ void __anyhit__kernel_optix_local_hit()
local_isect->num_hits = 1;
}
const int prim = optixGetPrimitiveIndex();
Intersection *isect = &local_isect->hits[hit];
isect->t = optixGetRayTmax();
isect->prim = prim;
@@ -185,6 +194,11 @@ extern "C" __global__ void __anyhit__kernel_optix_shadow_all_hit()
}
# endif
ccl_private Ray *const ray = get_payload_ptr_6<Ray>();
if (intersection_skip_self_shadow(ray->self, object, prim)) {
return optixIgnoreIntersection();
}
float u = 0.0f, v = 0.0f;
int type = 0;
if (optixIsTriangleHit()) {
@@ -314,6 +328,12 @@ extern "C" __global__ void __anyhit__kernel_optix_volume_test()
if ((kernel_tex_fetch(__object_flag, object) & SD_OBJECT_HAS_VOLUME) == 0) {
return optixIgnoreIntersection();
}
const int prim = optixGetPrimitiveIndex();
ccl_private Ray *const ray = get_payload_ptr_6<Ray>();
if (intersection_skip_self(ray->self, object, prim)) {
return optixIgnoreIntersection();
}
}
extern "C" __global__ void __anyhit__kernel_optix_visibility_test()
@@ -330,18 +350,31 @@ extern "C" __global__ void __anyhit__kernel_optix_visibility_test()
# endif
#endif
#ifdef __VISIBILITY_FLAG__
const uint object = get_object_id();
const uint visibility = optixGetPayload_4();
#ifdef __VISIBILITY_FLAG__
if ((kernel_tex_fetch(__objects, object).visibility & visibility) == 0) {
return optixIgnoreIntersection();
}
/* Shadow ray early termination. */
if (visibility & PATH_RAY_SHADOW_OPAQUE) {
return optixTerminateRay();
}
#endif
const int prim = optixGetPrimitiveIndex();
ccl_private Ray *const ray = get_payload_ptr_6<Ray>();
if (visibility & PATH_RAY_SHADOW_OPAQUE) {
if (intersection_skip_self_shadow(ray->self, object, prim)) {
return optixIgnoreIntersection();
}
else {
/* Shadow ray early termination. */
return optixTerminateRay();
}
}
else {
if (intersection_skip_self(ray->self, object, prim)) {
return optixIgnoreIntersection();
}
}
}
extern "C" __global__ void __closesthit__kernel_optix_hit()

View File

@@ -92,6 +92,14 @@ ccl_device_forceinline void kernel_write_denoising_features_surface(
else if (sc->type == CLOSURE_BSDF_HAIR_PRINCIPLED_ID) {
closure_albedo *= bsdf_principled_hair_albedo(sc);
}
else if (sc->type == CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID) {
/* BSSRDF already accounts for weight, retro-reflection would double up. */
ccl_private const PrincipledDiffuseBsdf *bsdf = (ccl_private const PrincipledDiffuseBsdf *)
sc;
if (bsdf->components == PRINCIPLED_DIFFUSE_RETRO_REFLECTION) {
continue;
}
}
if (bsdf_get_specular_roughness_squared(sc) > sqr(0.075f)) {
diffuse_albedo += closure_albedo;

View File

@@ -214,6 +214,21 @@ ccl_device_inline void film_get_pass_pixel_light_path(
pixel[0] = f.x;
pixel[1] = f.y;
pixel[2] = f.z;
/* Optional alpha channel. */
if (kfilm_convert->num_components >= 4) {
if (kfilm_convert->pass_combined != PASS_UNUSED) {
float scale, scale_exposure;
film_get_scale_and_scale_exposure(kfilm_convert, buffer, &scale, &scale_exposure);
ccl_global const float *in_combined = buffer + kfilm_convert->pass_combined;
const float alpha = in_combined[3] * scale;
pixel[3] = film_transparency_to_alpha(alpha);
}
else {
pixel[3] = 1.0f;
}
}
}
ccl_device_inline void film_get_pass_pixel_float3(ccl_global const KernelFilmConvert *ccl_restrict

View File

@@ -226,6 +226,18 @@ ccl_device float curve_thickness(KernelGlobals kg, ccl_private const ShaderData
return r * 2.0f;
}
/* Curve random */
ccl_device float curve_random(KernelGlobals kg, ccl_private const ShaderData *sd)
{
if (sd->type & PRIMITIVE_CURVE) {
const AttributeDescriptor desc = find_attribute(kg, sd, ATTR_STD_CURVE_RANDOM);
return (desc.offset != ATTR_STD_NOT_FOUND) ? curve_attribute_float(kg, sd, desc, NULL, NULL) :
0.0f;
}
return 0.0f;
}
/* Curve location for motion pass, linear interpolation between keys and
* ignoring radius because we do the same for the motion keys */

View File

@@ -29,46 +29,19 @@
CCL_NAMESPACE_BEGIN
/* Refine triangle intersection to more precise hit point. For rays that travel
* far the precision is often not so good, this reintersects the primitive from
* a closer distance.
/**
* Use the barycentric coordinates to get the intersection location
*/
ccl_device_inline float3 motion_triangle_refine(KernelGlobals kg,
ccl_private ShaderData *sd,
float3 P,
float3 D,
float t,
const int isect_object,
const int isect_prim,
float3 verts[3])
ccl_device_inline float3 motion_triangle_point_from_uv(KernelGlobals kg,
ccl_private ShaderData *sd,
const int isect_object,
const int isect_prim,
const float u,
const float v,
float3 verts[3])
{
#ifdef __INTERSECTION_REFINE__
if (!(sd->object_flag & SD_OBJECT_TRANSFORM_APPLIED)) {
if (UNLIKELY(t == 0.0f)) {
return P;
}
const Transform tfm = object_get_inverse_transform(kg, sd);
P = transform_point(&tfm, P);
D = transform_direction(&tfm, D * t);
D = normalize_len(D, &t);
}
P = P + D * t;
/* Compute refined intersection distance. */
const float3 e1 = verts[0] - verts[2];
const float3 e2 = verts[1] - verts[2];
const float3 s1 = cross(D, e2);
const float invdivisor = 1.0f / dot(s1, e1);
const float3 d = P - verts[2];
const float3 s2 = cross(d, e1);
float rt = dot(e2, s2) * invdivisor;
/* Compute refined position. */
P = P + D * rt;
float w = 1.0f - u - v;
float3 P = u * verts[0] + v * verts[1] + w * verts[2];
if (!(sd->object_flag & SD_OBJECT_TRANSFORM_APPLIED)) {
const Transform tfm = object_get_transform(kg, sd);
@@ -76,71 +49,8 @@ ccl_device_inline float3 motion_triangle_refine(KernelGlobals kg,
}
return P;
#else
return P + D * t;
#endif
}
/* Same as above, except that t is assumed to be in object space
* for instancing.
*/
#ifdef __BVH_LOCAL__
# if defined(__KERNEL_CUDA__) && (defined(i386) || defined(_M_IX86))
ccl_device_noinline
# else
ccl_device_inline
# endif
float3
motion_triangle_refine_local(KernelGlobals kg,
ccl_private ShaderData *sd,
float3 P,
float3 D,
float t,
const int isect_object,
const int isect_prim,
float3 verts[3])
{
# if defined(__KERNEL_GPU_RAYTRACING__)
/* t is always in world space with OptiX and MetalRT. */
return motion_triangle_refine(kg, sd, P, D, t, isect_object, isect_prim, verts);
# else
# ifdef __INTERSECTION_REFINE__
if (!(sd->object_flag & SD_OBJECT_TRANSFORM_APPLIED)) {
const Transform tfm = object_get_inverse_transform(kg, sd);
P = transform_point(&tfm, P);
D = transform_direction(&tfm, D);
D = normalize(D);
}
P = P + D * t;
/* compute refined intersection distance */
const float3 e1 = verts[0] - verts[2];
const float3 e2 = verts[1] - verts[2];
const float3 s1 = cross(D, e2);
const float invdivisor = 1.0f / dot(s1, e1);
const float3 d = P - verts[2];
const float3 s2 = cross(d, e1);
float rt = dot(e2, s2) * invdivisor;
P = P + D * rt;
if (!(sd->object_flag & SD_OBJECT_TRANSFORM_APPLIED)) {
const Transform tfm = object_get_transform(kg, sd);
P = transform_point(&tfm, P);
}
return P;
# else /* __INTERSECTION_REFINE__ */
return P + D * t;
# endif /* __INTERSECTION_REFINE__ */
# endif
}
#endif /* __BVH_LOCAL__ */
/* Ray intersection. We simply compute the vertex positions at the given ray
* time and do a ray intersection with the resulting triangle.
*/
@@ -153,14 +63,12 @@ ccl_device_inline bool motion_triangle_intersect(KernelGlobals kg,
float time,
uint visibility,
int object,
int prim,
int prim_addr)
{
/* Primitive index for vertex location lookup. */
int prim = kernel_tex_fetch(__prim_index, prim_addr);
int fobject = (object == OBJECT_NONE) ? kernel_tex_fetch(__prim_object, prim_addr) : object;
/* Get vertex locations for intersection. */
float3 verts[3];
motion_triangle_vertices(kg, fobject, prim, time, verts);
motion_triangle_vertices(kg, object, prim, time, verts);
/* Ray-triangle intersection, unoptimized. */
float t, u, v;
if (ray_triangle_intersect(P, dir, tmax, verts[0], verts[1], verts[2], &u, &v, &t)) {
@@ -175,8 +83,7 @@ ccl_device_inline bool motion_triangle_intersect(KernelGlobals kg,
isect->u = u;
isect->v = v;
isect->prim = prim;
isect->object = (object == OBJECT_NONE) ? kernel_tex_fetch(__prim_object, prim_addr) :
object;
isect->object = object;
isect->type = PRIMITIVE_MOTION_TRIANGLE;
return true;
}
@@ -196,25 +103,15 @@ ccl_device_inline bool motion_triangle_intersect_local(KernelGlobals kg,
float3 dir,
float time,
int object,
int local_object,
int prim,
int prim_addr,
float tmax,
ccl_private uint *lcg_state,
int max_hits)
{
/* Only intersect with matching object, for instanced objects we
* already know we are only intersecting the right object. */
if (object == OBJECT_NONE) {
if (kernel_tex_fetch(__prim_object, prim_addr) != local_object) {
return false;
}
}
/* Primitive index for vertex location lookup. */
int prim = kernel_tex_fetch(__prim_index, prim_addr);
/* Get vertex locations for intersection. */
float3 verts[3];
motion_triangle_vertices(kg, local_object, prim, time, verts);
motion_triangle_vertices(kg, object, prim, time, verts);
/* Ray-triangle intersection, unoptimized. */
float t, u, v;
if (!ray_triangle_intersect(P, dir, tmax, verts[0], verts[1], verts[2], &u, &v, &t)) {
@@ -266,7 +163,7 @@ ccl_device_inline bool motion_triangle_intersect_local(KernelGlobals kg,
isect->u = u;
isect->v = v;
isect->prim = prim;
isect->object = local_object;
isect->object = object;
isect->type = PRIMITIVE_MOTION_TRIANGLE;
/* Record geometric normal. */

View File

@@ -68,15 +68,7 @@ ccl_device_noinline void motion_triangle_shader_setup(KernelGlobals kg,
verts[1] = (1.0f - t) * verts[1] + t * next_verts[1];
verts[2] = (1.0f - t) * verts[2] + t * next_verts[2];
/* Compute refined position. */
#ifdef __BVH_LOCAL__
if (is_local) {
sd->P = motion_triangle_refine_local(kg, sd, P, D, ray_t, isect_object, isect_prim, verts);
}
else
#endif /* __BVH_LOCAL__*/
{
sd->P = motion_triangle_refine(kg, sd, P, D, ray_t, isect_object, isect_prim, verts);
}
sd->P = motion_triangle_point_from_uv(kg, sd, isect_object, isect_prim, sd->u, sd->v, verts);
/* Compute face normal. */
float3 Ng;
if (sd->object_flag & SD_OBJECT_NEGATIVE_SCALE_APPLIED) {

Some files were not shown because too many files have changed in this diff Show More