I'm gonna continue refactoring the code and keeping the reviewing process going. Thanks for the support everyone! :)
Finally into code review!
All about code reviewing. I'll try to attend the 10:00 CEST meeting and see what developers are thinking.
I will also include patches for other accessory modules for LANPR, including GPencil modifiers, smooth contour modifier, SVG functions and UI fixes. These patches will likely be generated upon LANPR for continuity.
deformStroke()) to make MultiStroke modifier more tolerant to multiple deform/generation modifier in the stack.
It's been a tough week for me the last few days. Thank god things finally cleared up on Monday :/ Next week should have a very free time frame.
Workflow reasons. Easy connect different software.
Here discusses the format that the proposed SVG exporter follows:
<?xml version="1.0" standalone="no"?> <svg width="4cm" height="4cm" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg" version="1.1"> <title>Example triangle01- simple example of a 'path'</title> <desc>A path that draws a triangle</desc> <rect x="1" y="1" width="398" height="398" fill="none" stroke="blue" />
LANPR is a versatile module that could potentially have much greater extensive use in the future, its development goal grows along with the project itself now. It's not very realistic to do everything in a short period of time. So we need to distinguish what needs to be down in this stage (GSoC and shortly after), and what is reserved for the future. Here in this passage I'll propose my plan.
Propose to include these parts into the first merge, which is supposed to happen within the GSoC time frame:
Lower priority, if not able to then put into the next stage:
In order to use LANPR alone, you need to switch to LANPR engine first, in LANPR, everything is drawn by LANPR. You may find the overlay stuff a bit obscure, you can disable it.
When using LANPR engine, line styles are controlled by line layers. You can add/remove line layers using +/- buttons on the side. One line layer controls one set of occlusion levels. By default you can have a single level layer, which starts from 0 (Means visible), and increases incrementally (means multiple levels of occlusion). Same as QI Range in Freestyle. To use QI range, click the "Onion skin" icon on the left, which lets you select a visibility range. "Default" button creates 3 layers, which let you see the internal structures. However just click the "+" once if you only want to use visible lines.
By default, all the line types uses the same line style. If you would like to specify different styles for different types of lines, uncheck "Same Style".
When you are ready, click "Update" at the top of LANPR panel. It will calculate the lines and prepare data for drawing. If you choose "Auto Update", LANPR will automatically run once you moved a frame.
When switched to viewport render mode, you should be able to see the result immediately. If not, click the viewport once.
Chaining You can disable chaining in CPU mode. There are two thresholds that controls the chaining, default value is pretty optimal, but there have been a slight problem within image-space chaining, you may notice some wiggly lines here and there.
I had three tests during the week and finally over all of them :D. Time to clean stuff up.
Mainly notes, will categorize into a design document later after basic implementation.
It should have such properties:
|Usage||Include/OcclusionOnly/Exclude||"Exclude" option will remove the object completely from line calculation thus the object will not occlude anything.|
|Types||Contour, Crease, Mark, Material, Intersection, ModifierOriginal||ModifierOriginal type is for marking the similar edges from the enabled "mesh" icon.|
|Target||GPencil object selector|
|Replace||Replace existing GPencil frame|
|Layer||Which layer to put GPencil strokes into.||Allow only one layer for now?|
|Material||The material indes it should use.|
|OcclusionRange||The QI range in Freestyle.||For allowing different occlusion level using different material and line config, add another LANPR modifier.|
|VertexGroup||Select vertex group for in/exclusion||Enough, no need to combine material logic.|
Grease Pencil has received a lot of great improvements since Blender2.8. LANPR used to render all the strokes by its own. Now GPencil already have some style and texture options that we are able to use, so It is also reasonable for LANPR to utilize this part of the functions. At the current stage, GPencil's modifiers and stroke material are of the most interests. Since Freestyle is well known for its ability to generate feature lines with artistic shapes and textures, and people loved it, so it is necessary for us to implement such kind of functions into LANPR.
Since we can already share data between LANPR and GPencil, we then need more stroke modifiers to help us achieve the target.This short proposal is dedicated to extending GPencil modifier development for better NPR rendering usages.
How do we get LANPR data into Grease Pencil eventually? Now it is done by manually calculate the feature lines, and then create GPencil modifiers. There's a need to automate the process, or at least to notify the user about LANPR data (Thanks for Antonioya for mentioning this). This process should be something like this:
To me the first solution may be better, since one can use the stroke generator with their existing GPencil objects, and later could utilize LANPR's line select functions to give different GPencil objects different strokes and effects. Both methods doesn't necessarily have to be executed in LANPR engine though, because GPencil is used to draw. Hence I also put it in this modifier proposal.
There are some requirements (which isn't of great importance if the only thing GPencil does is drawing) to meet specific needs for stylized rendering: Please give feedback on what you think is also necessary too.
(Reported on Friday, still some weekend works to do, and I have two tests this week :( )
In this week, there are mainly following things to address:
engine_free()from LANPR engine is not called when blender quits. Resulting in memory leaks. Maybe missing some registration parameters.
In UI aspect, currently LANPR has some major draw backs: