Commit Graph

177 Commits

Author SHA1 Message Date
Jeroen Bakker
8bab865539 Fix T72289: FreeStyle python error
Introduced by {T67981}. We changed the python API for curve evaluation.
Freestyle still used the old call that failed. This patch updates
FreeStyle to use the new API. I checked other areas in freestyle but it
seemed to be the only `evaluate` for curves that is called directly.

Reviewed By: zeddb

Differential Revision: https://developer.blender.org/D6430
2019-12-18 11:00:50 +01:00
Campbell Barton
c8c3e7d284 Cleanup: trailing space, remove tabs, pep8 2019-09-10 06:17:59 +10:00
28b1bbeb92 Fix T60625: freestyle colletion include / exclude not working. 2019-01-24 16:46:11 +01:00
Sergey Sharybin
7c7f3776dd Use collection and instance terminology in Python API
This follows naming convention agreed on in T56648.
2018-11-28 18:22:51 +01:00
4e37796976 Fix various Freestyle rendering bugs. 2018-11-05 00:22:33 +01:00
Bastien Montagne
a43ebc63fa Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/collision.c
2018-09-03 17:44:36 +02:00
4da2acae3a Spelling fixes in comments and descriptions, patch by luzpaz.
Differential Revision: https://developer.blender.org/D3668
2018-09-03 16:55:01 +02:00
Ton Roosendaal
51b796ff15 Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!

* Point density, voxel data, ocean, environment map textures were removed,
  as these only worked within BI rendering. Note that the ocean modifier
  and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
  with BI. If we ever wanted to support this again probably it should go
  through the baking API.
* GPU shader export through the Python API was removed. This only worked
  for the old BI GLSL shaders, which no longer exists. Doing something
  similar for Eevee would be significantly more complicated because it
  uses a lot of multiplass rendering and logic outside the shader, it's
  probably impractical.
* Collada material import / export code is mostly gone, as it only worked
  for BI materials. We need to add Cycles / Eevee material support at some
  point.
* The mesh noise operator was removed since it only worked with BI
  material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
  for BI material texture slots. Could be added back with node support.

* Not all legacy viewport features are supported in the new viewport, but
  their code was removed. If we need to bring anything back we can look at
  older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
  that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
  used anywhere now. We may eventually use this to replace the texture
  nodes with Cycles / Eevee shader nodes.

* The Cycles Bake panel now includes settings for baking multires normal
  and displacement maps. The underlying code needs to be merged properly,
  and we plan to add back support for multires AO baking and add support
  to Cycles baking for features like vertex color, displacement, and other
  missing baking features.

* This commit removes DNA and the Python API for BI material, lamp, world
  and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
  are reusing some old BI properties but the names are not really correct
  anymore.
* Texture slots for materials, lamps and world were removed. They remain
  for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
  other renderers use this to find all panels to show, minus a few panels
  that they have their own replacement for.
2018-04-19 17:35:25 +02:00
f9cf2e2f6c Workspaces: remove workspace engine, use 3D viewport draw mode instead.
ViewRender was removed, which means we can't get the render engine for files
saved in 2.8. We assume that any files saved in 2.8 were intended to use Eevee
and set the engine to that.

A fix included with this is that .blend thumbails now draw with Clay mode,
and never Eevee or Cycles. These were drawn with solid mode in 2.7, and should
be very fast and not e.g. load heavy image textures.

Differential Revision: https://developer.blender.org/D3156
2018-04-18 16:35:38 +02:00
Dalai Felinto
3abe8b3292 Rename any instance of scene layer or render layer in code with view layer
The RenderResult struct still has a listbase of RenderLayer, but that's ok
since this is strictly for rendering.

* Subversion bump (to 2.80.2)
* DNA low level doversion (renames) - only for .blend created since 2.80 started

Note: We can't use DNA_struct_elem_find or get file version in init_structDNA,
so we are manually iterating over the array of the SDNA elements instead.

Note 2: This doversion change with renames can be reverted in a few months. But
so far it's required for 2.8 files created between October 2016 and now.

Reviewers: campbellbarton, sergey

Differential Revision: https://developer.blender.org/D2927
2017-11-23 07:48:23 -02:00
Dalai Felinto
3a95bdfc65 SceneRenderLayer Removal/Refactor
This patch moves all the functionality previously in SceneRenderLayer to SceneLayer.
If we want to rename some of these structs now would be a good time to do it, before they are in SceneLayer.

Everything should be working, though I will test things further tomorrow. Once this is committed depsgraph can get
rid of the workaround added in rna_Main_meshes_new_from_object and finish whatever this patch was preventing from being finished.

This patch also adds a few placeholders for the overrides (samples, ...). These are obviously not working, so some unittests that rely on 'lay', and 'zmask' will fail.

This patch does not addressed the change of moving samples to ViewRender (I have this as a separate patch and needs some separate discussion).

Following next is the individual note of the individual parts that were committed.

Note 1: It is up to Cycles to still get rid of exclude_layer internally.
Note 2: Cycles still need to handle its own doversion for the use_layer_samples cases and

(1) Remove the override as it is
(2) Add a new override (scene.cycles.samples) if scene.cycles.use_layer_samples != IGNORE

Respecting the expected behaviour when scene.cycles.use_layer_samples == BOUNDED.

Note 3: Cycles still need to implement the per-object holdout
(similar to how we do shadow catcher).

Note 4: There are parts of the old (Blender Internal) rendering pipeline that is still
using lay, e.g., in shi->lay.

Honestly it will be easier to purge the entire Blender Internal code away instead of taking things from it bit by bit.

Reviewers: sergey, campbellbarton, brecht

Differential Revision: https://developer.blender.org/D2919
2017-11-22 07:13:33 -02:00
Dalai Felinto
86899c1adf Fix freestyle UI after workspace > engine changes 2017-10-25 12:25:43 -02:00
Campbell Barton
7260a693e1 Cleanup: trailing space 2017-07-25 01:28:15 +10:00
Aaron Carlisle
e1983adef4 PYAPI: Fix freestyle submodules without tocrees
Fixes 6 compile warnings
Follow up on rBf87ca5f1c314f67353b6111d3647aef159dc07c6
2017-06-14 14:42:44 -04:00
Campbell Barton
0b55b8cc6a Cleanup: triple quotes for docstrings 2017-04-14 20:01:43 +10:00
Aaron Carlisle
6d1ac79514 Cleanup: Grey --> Gray 2017-02-27 19:33:57 -05:00
Tamito Kajiyama
781507d2dd Freestyle: Feature edge selection by nested object groups.
A group of object groups can be formed by means of the dupli_group option in
the Object properties window.  The present revision extends the Selection by
Group option in the Freestyle Line Set so as to support not only flat object
groups but also nested groups.
2017-02-16 10:53:11 +09:00
Tamito Kajiyama
a2a7316d92 Fix T48366: Freestyle will unnecessary exclude some linked objects.
Group membership testing for including/excluding feature lines was not
accounting for object names possibly further qualified by library file
paths.

Also fixed a few potential (but unlikely) references of uninitialized
variables.

A big thank to Bastien Montagne for the insight on the cause of the
problem and how to fix it.
2016-08-05 22:25:16 +09:00
Tamito Kajiyama
734af18651 Freestyle: Fix for 'Distance from Object' modifiers without a target object.
'Distance from Object' color/alpha/thickness modifiers without a target
object were raising a run-time exception although it is not considered an
error condition.
2015-10-28 23:33:25 +09:00
Tamito Kajiyama
0e2bbd0904 Freestyle: Fix for round/square stroke caps causing line thinning.
This is a regression introduced in rBce729677db3e and rBb408d8af31c9.

RoundCapShader and SquareCapsShader had to remove (almost) overlapping
stroke vertices to avoid sudden thinning of line thickness.  For instance,
the test .blend file from https://developer.blender.org/T36425#231460
suffered from the reported line thinning (although T36425 was originally
caused by a different bug).
2015-07-23 20:29:23 +09:00
Tamito Kajiyama
e7a48113a9 Freestyle: Missing __all__ symbols added in D963. 2015-07-10 23:15:59 +09:00
Tamito Kajiyama
25638a9656 Code cleanup: White space and dead code. 2015-07-10 23:15:57 +09:00
Folkert de Vries
eeeb845d33 Freestyle: new stroke modifiers
This patch introduces a couple new stroke modifiers. The ones currently implemented are based on prototypes by @kjym3 and myself.

The new modifiers:
  - Tangent
  - Thickness noise
  - Crease Angle
  - Simplification
  - Curvature 3D

The documentation for these new modifier types can be found [[ http://www.blender.org/manual/render/freestyle/parameter_editor/index.html | in the manual ]]:

{F134441}
(left: AnisotropicThicknessShader, right: NoiseThicknessShader)

{F140499}
(left: Curvature 3D, right: Simplification)

Author: Folkert de Vries (flokkievids)

Reviewers: kjym3

Subscribers: #user_interface, plasmasolutions, kjym3

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D963
2015-07-10 23:15:56 +09:00
Tamito Kajiyama
3ca0870023 Improvements to the Freestyle Python API (needed by the SVG Exporter)
This patch adds some new functionality to the Freestyle Python API, notably:

  - MaterialBP1D, checks whether the supplied arguments have the same material
  - Fixes a potential crash in CurvePoint.fedge (due to NULL pointer)
  - Makes (error handling in) boolean predicates more robust
  - Adds a BoundingBox type, to make working with bounding boxes easier
  - Adds several new functions (get_object_name, get_strokes, is_poly_clockwise, material_from_fedge)
  - Adds a StrokeCollector StrokeShader, that collects all the strokes from a specific call to Operators.create()
  - Adds hashing and rich comparison to the FrsMaterial type

These new features (most of them, anyway) are needed for making a more robust SVG exporter that supports holes in fills.

Reviewers: kjym3, campbellbarton

Subscribers: campbellbarton

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1245
2015-05-31 23:16:45 +09:00
Tamito Kajiyama
b466a82fa5 Partial fix for T44404: freestyle crashes blender.
Logical predicates AndUP1D and OrUP1D were instantiated even with an empty
list of unary 1D predicates, causing an exception in the constructors of
the logical predicate classes.

This is a regression made in b408d8af31c9fba5898e353c97f95f7ce8dc19c1.
2015-04-16 13:35:24 +09:00
Tamito Kajiyama
0a304337e1 Freestyle: Fix for AndBP1D and OrBP1D not working due to typos.
Problem report by Folkert de Vries (flokkievids) through personal
communications.  Thanks!
2015-04-09 00:29:07 +09:00
Folkert de Vries
7d38d85340 Freestyle: Fix for references of deprecated texture stroke shaders.
Removed all references of deprecated texture shader.  Also deleted
several lines of dead code.

Since texture_shader.py no longer does what it was supposed to do,
the file itself was removed.

Patch reviewed by Tamito Kajiyama (kjym3).
2015-03-09 12:53:13 +09:00
Campbell Barton
7293291a40 cleanup: typos 2015-02-27 15:57:59 +11:00
Tamito Kajiyama
e1f5e19eee Freestyle: Avoid quietly ignoring errors in parameter_editor.lineset_pre callbacks. 2014-12-02 23:08:22 +09:00
Tamito Kajiyama
e3b68dbaf8 Freestyle: Py-Hooks for custom pre/post-processing line style
Patch D839, needed for SVG-render to be made into an addon.
2014-11-24 22:46:44 +01:00
Campbell Barton
4dd5b635e8 Revert "Freestyle: Built-in SVG exporter."
This reverts commit 61a330baca0ff9bb3cf477c04f539ef276a0356f.

This completes reverting D785

This feature is to be reworked into an addon.
2014-10-19 19:10:32 +02:00
Campbell Barton
4c86271bd9 Revert "Fix for rB61a330baca0f: Changed SVG file encoding from UTF-16 to UTF-8."
This reverts commit 490f2aeb8247463a7ea1a86a3a8c4246fcf45f23.
2014-10-19 19:09:58 +02:00
Campbell Barton
2103cf9355 Revert "Freestyle: rename module to export_svg"
This reverts commit db249b787fe0875944e00df1a3d12a58d9a07249.
2014-10-19 19:09:49 +02:00
Campbell Barton
b495395ee5 Revert "Freestyle: add GPL headers"
This reverts commit 3cbb066b838b4d52673f3fd76c2f695a3491b8b6.
2014-10-19 19:09:41 +02:00
Campbell Barton
a9fdb70162 Revert "Cleanup: pep8"
This reverts commit 06cdc35a68d9a0bd2a84fd92bda2be11318d46ff.
2014-10-19 19:09:33 +02:00
Campbell Barton
0f1c959b05 Revert "Cleanup: unused import"
This reverts commit fc7752b53c793a6985525d4c099108a97cd7867e.
2014-10-19 19:09:26 +02:00
Campbell Barton
dd2525c362 Revert "Freestyle: lazy load 'export_svg'"
This reverts commit c35a649a0a6c3c07bb8d56caba680887f726b9e9.
2014-10-19 19:09:18 +02:00
Campbell Barton
c35a649a0a Freestyle: lazy load 'export_svg'
Loading XML module, registering etree namespaces... etc
on startup for everyone on chance someone may want to export
an SVG from Freestyle is unacceptable.

This shouldn't have got through the review.

also disable loading when built without freestyle.
2014-10-18 17:49:06 +02:00
Campbell Barton
fc7752b53c Cleanup: unused import 2014-10-18 17:32:05 +02:00
Campbell Barton
06cdc35a68 Cleanup: pep8 2014-10-18 17:30:46 +02:00
Campbell Barton
3cbb066b83 Freestyle: add GPL headers 2014-10-18 17:28:24 +02:00
Campbell Barton
db249b787f Freestyle: rename module to export_svg
Convention for existing export modules
2014-10-18 17:25:55 +02:00
Tamito Kajiyama
490f2aeb82 Fix for rB61a330baca0f: Changed SVG file encoding from UTF-16 to UTF-8. 2014-10-18 23:42:16 +09:00
Tamito Kajiyama
61a330baca Freestyle: Built-in SVG exporter.
Features:
* Both still image and animation rendering, as well as polygon
  fills are supported.
* The exporter creates a new SVG layer for every Freestyle line
  set. The different layers are correctly sorted.
* SVG paths use data from line styles, so the base color of a
  line style becomes the color of paths, idem for dashes and
  stroke thickness.
* Strokes can be split at invisible parts.  This functionality is
  useful when exporting for instance dashed lines or line styles
  with a Blue Print shader
* The exporter can be used not only in the Parameter Editor mode,
  but also from within style modules written for the Python
  Scripting mode.

Acknowledgements:
The author would like to thank Francesco Fantoni and Jarno
Leppänen for their [[ https://github.com/hvfrancesco/freestylesvg | Freestyle SVG exporter ]].

Differential revision: https://developer.blender.org/D785

Author: flokkievids (Folkert de Vries)

Reviewed by: kjym3 (Tamito Kajiyama)
2014-10-18 18:35:29 +09:00
Tamito Kajiyama
f4a260fb3c Fix T42198: Linked lines only work with linked objects.
The reported issue was caused by a backward incompatibility due to careless
code changes made when per-material Freestyle line colors were introduced
in rB7915d7277ac8c605f016f30f943080556244fb59.  In 2.71 line style
Material color/alpha/thickness modifiers was retrieving alpha transparency
from Material.alpha, whereas in 2.72 Material.line_color[3] was referenced.

The present fix reverts the aforementioned code changes.

This issue is a regression from 2.71, so the fix is appropriate for inclusion in
the 2.72a release.
2014-10-14 01:14:33 +09:00
Tamito Kajiyama
14df7de916 D801: Freestyle: remove old and unused stroke shaders
This patch removes several stroke shaders written in C++ that are unused
and don't serve a real purpose any more.  The removed shaders are:

  - BPy_ColorVariationPatternShader
  - BPy_StrokeTextureShader
  - BPy_TextureAssignerShader
  - BPy_ThicknessVariationPatternShader
  - BPy_fstreamShader
  - BPy_streamShader

and a few more that weren't even exposed to the Python API.

Some minor edits were made by the reviewer.

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

Reviewed by: kjym3
2014-10-09 01:31:07 +09:00
Tamito Kajiyama
2cb134be2b Freestyle: New line style options for sorting and chain selection.
The following two sort keys are added for sorting chains.

* Projected X - Sort by the projected X value in the image coordinate system.
* Projected Y - Sort by the projected Y value in the image coordinate system.

A new line style option for the selection of first N chains is also added.

Moreover, the chain sorting and chain selection operations are now executed
in this order instead of the reverse order used previously.  The UI has also
changed accordingly.  This functional change is backward compatible and
won't result in visual differences.
2014-10-01 16:01:40 +09:00
Tamito Kajiyama
55aa42ad6f Freestyle: Fix for a typo in the definition of NotBP1D.
This is a safe fix for a regression from 2.71, so should be back ported to 2.72.
2014-10-01 16:01:38 +09:00
Tamito Kajiyama
1c8d9cc4a9 Freestyle: Fix for irrelevant docstring showing up in Python API docs. 2014-09-19 14:11:32 +09:00
Tamito Kajiyama
64ade99ecc Freestyle: Python API documentation updates.
Fixed dead references of API identifiers (e.g., freestyle.types.Interface0D)
due to relocations of the identifiers into submodules.  Also made various minor
revisions of mark-ups and typos.
2014-09-19 13:41:47 +09:00