Search Unity

[Deprecated] PaintCraft (Multiplatform coloring book & drawing app constructor)

Discussion in 'Assets and Asset Store' started by nicloay, May 17, 2016.

  1. vzlomvl

    vzlomvl

    Joined:
    Jun 25, 2016
    Posts:
    43
    Hi @nicloay. Any news when 2.3 will be in the Asset Store? Thanks.
     
  2. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    Hello all fixes and api is ready, but there are small issues which i still to mitigate on android (when you fast click on undo /redo).
    If you need access to beta just drop the invoice ID to support@paintcraft.in and I'll send you the link.

    I think I'll release it to asset store in next week or two.

    Thanks. and sorry for inconvenience.
     
  3. MrFigment

    MrFigment

    Joined:
    Jan 5, 2017
    Posts:
    27
    Hi @nicloay, Is there an option to do a constant painting with only pressing the screen without moving? I had an old version of PainCraft and I manage to do that, but in the new version I can't.
    Thanks
     
  4. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    Hello. Please check https://nicloay.gitbook.io/doc-paintcraft-in/v/master/documentation/tool-pipeline following page. Then you need to adjust the filter which make the floodfill. Now it's paint on the last point and you need to change the code for the bucketFilter.cs to paint for the first point.
     
    MrFigment likes this.
  5. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    @nicloay
    Hi there,
    is this asset being supported in 2019? what are future plans?
     
  6. MrFigment

    MrFigment

    Joined:
    Jan 5, 2017
    Posts:
    27
    If I want to do a constant painting with the spray brush without moving the finger, how does I need to configure?
    When I dont move the finger I got a value of PointStatus.CopiedToCanvas in the RenderSwatch.cs
     
  7. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    Hello. I'm planing to release new version soon which will have many fixes and optimizations. and continue support as I did it before (usually I reply within one business day by email).
    For the future I'm thinking to release specialized version of complete project based on paintcraft, one of them is basic antistress coloring book andother is the coloring book for kids.
     
  8. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    Please check this page https://nicloay.gitbook.io/doc-paintcraft-in/v/master/documentation/tool-pipeline I think you just need to remove the first filter (remove duplicate points) on the beginning and set next filter as first.
     
  9. MrFigment

    MrFigment

    Joined:
    Jan 5, 2017
    Posts:
    27
  10. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    I'm sorry you right. Please check following screenshot
    Screen Shot 2019-05-10 at 08.07.31.png
    Old branch is the way how it works by default (Confetti brush). Replace it with new, and after doing that you can remove both nodes from Old branch. Also Make sure that "Start Node" is set properly on the (SetLastPointReadyToApply) filter.

    The way it works is. 1st we set last point from input ready to apply which means it will be rendered to the canvas, but "RenderSwatchCB" filter render only normal points (not the one which come from input) so we copy base points to normal points

    Hope this helps. Please let me know if you will have any questions.

    Thanks.
     
  11. MrFigment

    MrFigment

    Joined:
    Jan 5, 2017
    Posts:
    27
  12. Lednar

    Lednar

    Joined:
    Jan 9, 2018
    Posts:
    14
    Hey, any news to support pressure sensitive styluses? Right now its possible to paint with multiple fingers at once. Is it possible to replace this functionality to zoom option? If multiple fingers detected then active zoom and rotate tool?
     
  13. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    Hello Lednar. have you seen this doc https://nicloay.gitbook.io/doc-paintcraft-in/qookbook/change-size-according-to-pressure it show how to bind scale to preasure.

    About multiple fingers I have some idea how to implement that in paintcraft I did that in another projects where I used paintcraft as the base, but don't have strict plans when I'll include that in to the paintcraft package
     
  14. GavinCkw

    GavinCkw

    Joined:
    Mar 23, 2019
    Posts:
    6
    Is there anyway i can re-scale the brush size like with a " + " and " - " button
     
  15. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    Yes in demo project with 6 images you can see how slider is change the scale value. you can write your own button controller which adjust scale when it pressed.
     
    GavinCkw likes this.
  16. GavinCkw

    GavinCkw

    Joined:
    Mar 23, 2019
    Posts:
    6
    Thank you!
     
  17. omechano

    omechano

    Joined:
    Sep 12, 2014
    Posts:
    24
    When is the release date for new plugin ?
     
  18. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    I'm sorry I don't have exact date, I still fixing and testing. Please send your invoice id to support@paintcraft.in and I'll send you new RC version it has fixed saving procedure.
     
  19. pandemik

    pandemik

    Joined:
    Mar 23, 2017
    Posts:
    11
    Hello nicloay,

    You have a great product, i've been using it religiously for the past few years! Ive been looking into implementing the"pinch to zoom" feature that you have mentioned in the previous posts. I have it working in my coloring scene but it alters the behavior of the floodfill and stamp brush (the flood fill doesnt work with a tap, and the stamp tool wont allow me to see where the stamp is being placed until I release my finger), I understand that the reason that it occurs is because the brushes are meant to work with multitouch not singletouch. Is there any workaround for this?
     
  20. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    Hello @pandemik, thanks a lot for your feedback

    What I do in another projects based on paintcraft are
    1. implement custom input controller. - you can find that you just need to derrive from it and then call 3 methods (start,continue, end line).
    2. Use fingers (asset store free package) to distinguish different gestures and assign different behaviours
    3. Implement camera control script which work with fingers gesture.

    Hope this helps.
    //Nikolay.
     
  21. pandemik

    pandemik

    Joined:
    Mar 23, 2017
    Posts:
    11
    Thanks for your swift response.. Ive achieved 2 and 3 on your list but im having trouble understanding what to do with the input controller. If possible can you elaborate on what I need to do on this step?
     
  22. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    Here is some snippets
    1. Create new class which inherit the Input controller like this
    Code (CSharp):
    1. public class ToolProxy : InputController
    2. Subscribe to gesture events (In my case CameraData generate proper events. in your case it's probably fingers gesture)
    Code (CSharp):
    1. void Start()
    2.         {
    3.             CameraData.Events.OnPanBegin.AddListener(screenPosition => OnPanBegin(screenPosition, PanLineConfig, PanLineId));
    4.             CameraData.Events.OnPan.AddListener((previousPosition, currentPosition) => OnPan(currentPosition, PanLineConfig, PanLineId));
    5.             CameraData.Events.OnPanEnd.AddListener(screenPosition => OnPanEnd(screenPosition, PanLineConfig, PanLineId));
    6.         }
    3. Because you inherited from input controller you can call Begin, continue, end line. for example here is how OnPanBegin looks like in my case
    Code (CSharp):
    1. private void OnPanBegin(Vector2 screenPosition, LineConfig lineConfig, int lineId)
    2.         {          
    3.             if (lineConfig.Brush == null)
    4.             {
    5.                 return;              
    6.             }
    7.             Vector3 worldPosition = GetWorldPosition(screenPosition);
    8.             if (IsIgnoredPosition(worldPosition))
    9.             {
    10.                 return;
    11.             }          
    12.             _isPanStarted = true;
    13.             Events.OnTollStart.Invoke(lineConfig, worldPosition);
    14.             BeginLine(lineConfig, lineId, worldPosition, true);
    15.         }
    16.  
    17. Vector3 GetWorldPosition(Vector2 screenPosition)
    18. {
    19.    Vector3 vector3ScreenPosition = screenPosition;
    20.    vector3ScreenPosition.z = transform.position.z;
    21.    return ScreenCamera.ScreenToWorldPoint(vector3ScreenPosition);
    22. }
    23.  
     
  23. pandemik

    pandemik

    Joined:
    Mar 23, 2017
    Posts:
    11
    Thanks for the support unfortunately i still cant figure it out due to my limited C# knowledge. Hopefully i can figure it out in the future or it will be supported in a future release. Keep up the great work
     
  24. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
  25. Chris_DC

    Chris_DC

    Joined:
    Dec 7, 2016
    Posts:
    7
    I am using a region texture (only white sections with 0 alpha where i dont want to draw). I am wanting to be able to start drawing outside of the region, but have the line show up inside the proper region. Right now I have to start inside the region to begin drawing. Is there a change i can do to the script to allow the tools to start outside of the region but only display inside?
     
  26. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    I think it is possible. in the shader used by swatch rendering you have to compare just RGB color if they match. and use Alpha as result boolean operation (render or not).
     
  27. Chris_DC

    Chris_DC

    Joined:
    Dec 7, 2016
    Posts:
    7
    This worked great. Thanks so much!
     
    nicloay likes this.
  28. Dipanker_Juego

    Dipanker_Juego

    Joined:
    Jun 28, 2017
    Posts:
    10
    Hi @nicloay I am have problem in transparent background scene, on starting of transparent background scene everything working fine but if I changed the resolution the shader of BackLayer turns to white.

    Screen Shot 2019-06-28 at 4.14.04 PM.png Screen Shot 2019-06-28 at 4.14.19 PM.png
     
  29. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    Hello @Dipanker_Juego, do you use latest version from asset store or beta?
     
  30. Dipanker_Juego

    Dipanker_Juego

    Joined:
    Jun 28, 2017
    Posts:
    10
    Hi @nicloay thanks for the reply, actually I checked the code, you are using HandleChangeScreenSize in CanvasController by which its loading the saved image back. It's there a way to save image in transparent background instead of white.
     
  31. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    Dipanker_Juego likes this.
  32. Dipanker_Juego

    Dipanker_Juego

    Joined:
    Jun 28, 2017
    Posts:
    10
    Hello @nicloay thanks for help. One more help please, I am using screen res of 1920*1080 and painting in full screen. There is some delay in painting/drawing when mouse is moving, mouse cursor will be ahead and the drawing will be delayed but in 1024*768 works fine. It's there way to increase the speed.

    Thank You

    Screen Shot 2019-07-02 at 6.26.20 PM.png Screen Shot 2019-07-02 at 6.26.35 PM.png
     
  33. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
  34. Dipanker_Juego

    Dipanker_Juego

    Joined:
    Jun 28, 2017
    Posts:
    10
  35. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    I think you can also reduce the spacing in spline interpolator - maybe it will help to save some CPU/GPU power
    https://nicloay.gitbook.io/doc-paintcraft-in/documentation/tool-pipeline

    by the way what profile show, what's the main bottle neck for you is it gpu or cpu ?
     
  36. NirabhraDas

    NirabhraDas

    Joined:
    Aug 17, 2017
    Posts:
    3
    Hi, I'm trying to make a floodfill tool which will fill the region with a texture instead of a solid color. Till now the basic floodfill tool with a little change in material and shaders is working. But What I'm getting is a fill where the texture is stretched to fill the whole region. I have implemented tiling with change to the material itself But I cannot find a way to automate it. And the tiling would have to be done manually.

    For now, I am uploading the brush and the error that comes with it. It would be very helpful if someone could figure out the reason of the error
     

    Attached Files:

  37. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    please check
    SyncTextureRatioWithCanvas.cs class it setup scaling there you can automate the process.
     
  38. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    About the error. Please check the
    SetMaterial.cs class you can find there that the material is not cached. what you can do is just to make lazy initialization - check if it's null - then assign it something like this (just replace it starting from line 26)
    Code (csharp):
    1.  
    2. if (_material == null){
    3.     _material = new Material(Material);
    4. }
    5.  
     
  39. ellenblomw

    ellenblomw

    Joined:
    Mar 4, 2018
    Posts:
    153
    Hello, I can't add new pages to the coloring book. I get two errors when I try to place the icon, baseline or outline in the config and then the whole config is broken. Both errors says:
    Error code1: InvalidOperationException: Sequence contains no matching element

    How do I fix this? Am using 2018.3.0f2

    Same error happens if I create a new config and then try to add your original demo resource images
     
  40. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    replied to you by email.
     
    ellenblomw likes this.
  41. Marnelle

    Marnelle

    Joined:
    Apr 14, 2015
    Posts:
    17
    Подскажите, как я могу разместить UI Image под самой раскраской?
     
  42. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    если UI Image подразумевается Image из стандартного юнити UI - то тогда нужно по аналогии с 3D разместить рендер текстуру через RawImage в UI поверх вашего UI Image. но в этом случае придется наверно написать другой InputController который будет брать данные позиции из UI.

    А... хотя можно же UI Image разместить на GlobalUI канвасе (ScreenSpace-World) и разместить UI позади канваса. Посмотрите демо сцену с прозрачным канвасом.
     
    Marnelle likes this.
  43. Marnelle

    Marnelle

    Joined:
    Apr 14, 2015
    Posts:
    17
    Спасибо большое! Сработал даже канвас с камерой)
    Подскажите, а как можно BackLayer и Outline обрезать по маске UI Image?
     
  44. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    1. Через шейдер оба слоя это обычные квадратные меши с материалами, можно дописать маску туда
    2. Если в UI то опять же через RawImage (но тут сложнее)
     
  45. Marnelle

    Marnelle

    Joined:
    Apr 14, 2015
    Posts:
    17
    А как первое делается, не подскажете?)
     
  46. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    в шейдере указывать 2ю текстуру в которую передавать маску и после в тексельном шейдере просто цвет умножать на alpha либо использовать discard если поддерживается. погугли cutout shader
     
  47. Chris_DC

    Chris_DC

    Joined:
    Dec 7, 2016
    Posts:
    7
    Hi, with the release of 2019.2 we were going to move our game to use the LWRP, I am having some issues with the integration of the tool. I am working through updating to see if i can get it to work. Do you know if this would be possible?
     
  48. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    Hello @Chris_DC, Do you have problem with beta (3.0RC version) or in 2.2 from asset store.
     
  49. Chris_DC

    Chris_DC

    Joined:
    Dec 7, 2016
    Posts:
    7
    I am on 2.2 from the asset store. Where would i find the beta to try out?
     
    Last edited: Aug 1, 2019
  50. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    @Chris_DC can you send me your invoice id to support@paintcraft.in and i'll send you the 3.0 beta. It doesn't use camera and access directly Graphics.CommandBuffer, so it's a good chance that it will works well on any version (2017-2019)

    Thanks.