Draw some straight lines with the Polyline Tool. It will delete its previous strokes when new lines are added close to them, even if they belong to a different frame/layer
It does not delete strokes from other drawing tools (pen, Pencil, Brush)
This is drawn on the same frame, but I suspect its the same behaviour.
https://www.youtube.com/watch?v=0DyrH3E-clg
It seems there is some big work to do with the polyline tool.
@feeef I agree... I'm cross referencing this this forum topic http://www.pencil2d.org/forums/topic/bitmap-polyline-issues/
My thoughts at the moment, is to make the polyline tool available for vector mode. I don't think it makes much sense in my mind to have it as a bitmap mode imho. The current polyline tool is having to deal with apples and pomegranates in the unhttp://www.pencil2d.org/forums/topic/bitmap-polyline-issues underlining data structures and when we fix something for bitmap I suspect wheel break it vector and vice versa. I think there needs to be consensus on this before going that route.
edit..
See next post. I think this can be done with out using a Q_emit. See next post.
If we want to limit the polyline tool to only vector mode, it seems to me that the place to do it would be here: (perhaps setup some type of listener to pick up on the Q_EMIT currentLayerChanged( mCurrentLayerIndex ); in order to make the polyline visible or invisible?
@chchwy are you ok with me proceeding to disabling polyline for bitmap and optimzing it for vector mode.
void LayerManager::setCurrentLayer( int layerIndex )
{
if ( mCurrentLayerIndex != layerIndex )
{
mCurrentLayerIndex = layerIndex;
** Q_EMIT currentLayerChanged( mCurrentLayerIndex );
** }
if ( editor()->object()!=nullptr )
{
if ( editor()->object()->getLayer( layerIndex )->type() == Layer::CAMERA )
{
lastCameraLayer = layerIndex;
}
}
}
void LayerManager::setCurrentLayer( Layer* layer )
{
Object* o = editor()->object();
for ( int i = 0; i < o->getLayerCount(); ++i )
{
if ( layer == o->getLayer( i ) )
{
setCurrentLayer( i );
return;
}
}
I was looking at this a little deeper, It appears that the layer manager has a pointer to to the current layer.
It seems to me we need to add a method that returns the current layer type in the layer manager.
The editor has a private pointer to the layer manager.
We need is a public method in the editor to return the current layer type.
(A reference to the editor appears in the toolmanager via the basemanager, so we should be able to figure out what is the current layer to toggle visibility of the appropriate tool based on what the currrent layer is..
I think the polytool should exist for both vector and bitmap. How else will you be able to create straight lines?
Just thinking out loud... How to you draw a straight line with a physical pencil? You use a ruler.. What about creating a virtual ruler that can be used with any of the pen/pencil tools to draw a straight line. Or a virtual french curve or whatever...
I like to suggest that a polyline really lends itself to a vector mode. Say for example, you want to draw a stick figure. You could clone it to a new layer and then move the joints by repositioning the nodes.
Perhaps another way to think about it is that the Bitmap mod represents the closest representation to pencil and paper, where the vector mode is closer to computer graphics and cad.
I suppose there could also be a conversion feature at some point to convert a vector to a bitmap and a merge layer feature.
I also think the polyline tool should exist in bitmap mode. It is very difficult being precise with a physical ruler on a wacom tablet even on a Cintiq.
Polyline is a very useful tool even in bitmap mode. Especially to draw backgrounds.
This tool is fixable and should be fixed.
I think it's time to decide what to do with the Polyline tool to be honest. I think originally it was conceived as a tool to help the clean-up along with the vector layers (that's why it had that "bezier" half-baked mode)
First we need to define what we need it for, I'll write down some ideas for it's most common uses.
Bitmap Layer (Not editable, destructive) & Vector Layers (Editable, Non-destructive):
1) Clean-Up or Drawing of Mechanical Drawings (Objects: Cars, planes, etc - Props: table, chairs, etc)
2) Clean-Up or Drawing of Architectural Drawings (Layouts: Interior Environments, Exterior Buildings, etc)
3) Clean-Up or Drawing Curved Motifs or Logos
To be honest the requested "straight line" command, should be a short-hand shortcut for every drawing tool (pencil, pen, brush & eraser), and not a tool in itself, like every other drawing program does, because it IS expected to behave that way.
I can also think of two paths for implementing an improved Poliline Tool (a.k.a Bezier tool):
1) Make the polyline tool an "all-in-one" tool for creating bezier type lines by using editable control points that modify the shape of the stroke (think the pen tool from illustrator, inkscape or photoshop)
2) We separate the polyline tool and leave it only as a "straight line" tool
I prefer point 1, but think that aside from having a true "editable bezier tool", including drawing "_assistants_" (rulers, perspective grids, etc) similar to what Krita offers.would benefit greatly those who practice classical -hand-drawn- animation, which is the primary audience for this app.
There are many people that still use pen and paper to plan their layouts and storyboards, of course. So why not improve both bitmap and vector engines (through the tools) to support these kind of workflows that happen naturally during the animation production pipeline?
I think Pencil2D should _not be thought out as another "drawing tool" with animation capabilities_, if someone ever felt that, but rather we should try to make it the 'default' open-source toolbox for professional animators, so those who have limited resources or even big studios won't need to jump between multiple tools to perform their craft. Efficiency in production is top priority, and that comes with well designed tools.
Of course the particulars of what Pencil2D will be capable of, remain to be discussed, and even if this sounds "out-of-scope" it's really THAT big of a deal that we get this and other tools in the right mind-set before moving on with the more sophisticated engineering.
I guess that the polyline tool should only handle straight lines in bitmap mode. It should only handle Bezier curves in Vector mode but it will have to integrate Bezier curves handles. This is one important feature to implement in the vector engine.
In a first step, let's get rid of the Bezier curves feature in the Bitmap mode. Let's make the polyline tool a simple and efficient tool to make straight lines.
@JonasThomas if you have difficulties with the code, I can give you a hand!
@feeef I don't know if you read my previous comment but, is it really necessary (both for artists and developers) to create a tool only to make straight lines?
Is it not possible to make a bezier spline pen-type tool for both bitmap and vector layers? I mean, having sort of a "floating" representation of the line before it is "drawn" on the canvas so that it could work for both layers?
Or what exactly do you have in mind? If you guys clean the polytool out of any clunky behaviour can it be extended later on in a similar manner? I just want to understand the choices being made for this :)
@feeef
I uploaded my thoughts on the polyline tool comparing it to how freecad behaves but didn't realize I had hadn't published it. Anyway no published. I thought it might be of interest.
https://www.youtube.com/watch?v=YFqiK2EHWkA
Ok.. So this what I think I'm hearing:
I guess we're going to have poly-line in both bitmap and vector that鈥檚 going to be stripped down to just to make straight lines of uniform thickness
It sounds there a need for some type of virtual eraser template for assisting the cleaning up drawings.
It sounds like we need a Bezier tool should that could be applied for both bitmap and vector mode
Questions?
Would there be a need for a virtual ruler (straight or curved) that would allow the the user to use the pressure features of a wacom to vary the line thickness but the ruler would software correct to keep the path on the ruler?
Would we want add some type of snap to grid functionality to polyline at some point?
Would we to eventually be able to create vector stick figures for the rough draft story boards?...... Perhaps some type of basic shape library where limb lengths could be stretched and locked. Maybe the stick figure should be be positional in 3d space but projected on a 2d plane?
@JonasThomas , @Jose-Moreno , what I propose is just to simplify the behaviour of the polyline in Bitmap mode in order to make it work for the next release. It is just an easy first step to make the 0.6 version happen.
Even if the polyline feature remains very basic in this first step (no Bezier curve) the most important is that it works with no bug. It is not the most important tool in a traditional 2D animation program so it can wait another version to be full featured.
Also, having a virtual ruler is another very interesting option indeed. The way the ruler works in Krita is pretty amazing! https://www.youtube.com/watch?v=xvQ5l0edsq4 (go to 5:07)
However, this would be to be implemented after the bug fixing as this kind of feature requires some work and is not as important as other features.
@feeef , @Jose-Moreno
I think that ruler feature is cool. (Better than what I had in mind) and yes... after bug fixing.
We're on the same page with the polyline..
As far a 0.6 release.. Is there a list of issues that need comple off to say, we're ready to release .6?
Well, I guess that when we have no more bugs in the bug list, we are ready for 0.6! :-p Haha!
Actually, we will have to ask @chchwy what he had plan for the 0.6 release. I have no idea.
@feeef @JonasThomas Sounds like a plan then! Indeed it does not have to be the most perfect tool right now, and if simplifying it for the sake of bug fixing helps to improve the code, let's go for it!
Besides Krita has an API, an an "assistant" like behaviour can be implemented later on when we have a relatively stable app.
http://api.kde.org/bundled-apps-api/calligra-apidocs/krita/plugins/assistants/html/annotated.html
On a side note: I've been thinking we too might need an API in the future or at least something similar to a "Pencil2D Programming Documentation / Reference", because I feel sometimes those who come in to help don't really know what every function does, and even for you guys who are quite skilled at coding I'm sure you've had to dedicate a lot of time to understand how the code works instead of writing the code you want. I'll post a new thread later on paging all the devs to gather ideas on how to build a groundwork for this.
Keep up the great work and thank you for your time!!!
@feeef , @Jose-Moreno
Just wanted to check in... I'm in the process of separating the bezier and polylne into separate classes.
Part of the goal being that we have a polyline in both vector and bitmap...
This is turning in a bit of a challenge. I've managed to get them split and the project built, but it's going to be a week or two before I have something to show
@JonasThomas, it sounds fine to me. I don't really know the code of the polyline tool but splitting the code when there is too much, in order to make things clearer within the classes shouldn't be a bad idea IMHO.
@JonasThomas Thank you for your hard work! As long as you are satisfied with your proposed solution, we don't mind waiting for sure! You people are doing great work and It is really nice to see this project is at least moving forward one line of code at a time, so if you don't find time to work on this don't sweat it, we all have real-life commitments and the code isn't child's play either, so keep up keeping on! :+1:
It's not possible to fix all bugs soon, so I start to make a issue list that need to be fixed before 0.6 release in my opinion, you could see the issue list in 0.6 Milestone
Welcome to add any issue to the milestone if you think it's a urgent issue.
The _"Polytool erases nearby polylines"_ is no longer an Issue. (last build 31August2017)
Despite the Title, there are comments that may be needed to read them again. If not, and as this issue was fixed, I suggest you to close this post
Thanks
@tasaif @JonasThomas @chchwy @Kaikogf @feeef A few years have gone by already, but testing this in the latest version doesn't seem to reproduce this bug anymore. I just want to personally thank you all for the discussions and assistance you all provided to improve the project back then, we've still very much alive, have improved the app and will keep going. Thanks a lot for your help; this issue can be closed now :slightly_smiling_face:
Most helpful comment
@tasaif @JonasThomas @chchwy @Kaikogf @feeef A few years have gone by already, but testing this in the latest version doesn't seem to reproduce this bug anymore. I just want to personally thank you all for the discussions and assistance you all provided to improve the project back then, we've still very much alive, have improved the app and will keep going. Thanks a lot for your help; this issue can be closed now :slightly_smiling_face: