Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Solved
    • Unsolved
    • Search
    1. Home
    2. General Discussion
    Log in to post

    General Discussion

    • MishaHeesakkers

      SOLVED When exporting a large amount of frames is there a possibility to track the duration of this process?
      animation • • MishaHeesakkers  

      5
      0
      Votes
      5
      Posts
      633
      Views

      frederik

      oh, there is indeed no progress callback on saveImage(..) Doing some googling on 'progress' and 'ffmpeg' does not results in a clear solution. DrawBot has a small wrapper around ffmpeg to generate movies: see https://github.com/typemytype/drawbot/blob/master/drawBot/context/tools/mp4Tools.py
    • MishaHeesakkers

      SOLVED Are there any tutorials on how to build Drawbot python files via Sublime?
      drawbot as module • • MishaHeesakkers  

      4
      0
      Votes
      4
      Posts
      523
      Views

      gferreira

      @MishaHeesakkers animated gifs can be viewed with a browser. see this example
    • brintown

      SOLVED Masking
      clipping • • brintown  

      4
      0
      Votes
      4
      Posts
      518
      Views

      brintown

      thanks @frederik and @gferreira for the helpful hints!
    • micahmicah

      SOLVED Typographic white space?
      text • • micahmicah  

      3
      0
      Votes
      3
      Posts
      511
      Views

      micahmicah

      @frederik wonderful! Thank you!
    • MauriceMeilleur

      SOLVED while()
      • MauriceMeilleur  

      4
      0
      Votes
      4
      Posts
      939
      Views

      frederik

      see also http://pythonfordesigners.com/how-to-keep-doing-things-until-you-need-to/ http://robofont.com/documentation/building-tools/python/collections-loops/#while-loops
    • pixelman

      SOLVED change number to count number 1, 2 or 3
      • pixelman  

      2
      0
      Votes
      2
      Posts
      491
      Views

      gferreira

      @pixelman you can add a counter to the inner loop using enumerate: for n, words in enumerate([words1, words2, words3], start=1): if i < len(words): resultWords.append('-'+ str(n) +'-'+ words[i])
    • snaders

      SOLVED Add fontVariation to text drawn in bezierPath?
      bezierpath variable fonts • • snaders  

      6
      0
      Votes
      6
      Posts
      1997
      Views

      frederik

      super! really cool project!
    • Patricia

      SOLVED Making a book
      animation book • • Patricia  

      5
      0
      Votes
      5
      Posts
      1210
      Views

      Patricia

      @gferreira Thanks so much!
    • MauriceMeilleur

      SOLVED arcTo documentation?
      bezierpath • • MauriceMeilleur  

      8
      0
      Votes
      8
      Posts
      1483
      Views

      frederik

      see https://github.com/typemytype/drawbot/commit/d989e8bd0db35489d3eaeca453366d70a8877a1e
    • jens

      SOLVED Detect if a module is imported from a DrawBot script?
      modules drawbot as module • • jens  

      4
      0
      Votes
      4
      Posts
      803
      Views

      frederik

      DrawBot could be installed as module, so the import could be available. check: import AppKit appName = AppKit.NSBundle.mainBundle().infoDictionary().get("CFBundleDisplayName") print(appName) appName will be DrawBot, RoboFont or None (in terminal) good luck!
    • snaders

      SOLVED Draw a letter within a viewbox
      bezierpath transformations • • snaders  

      5
      0
      Votes
      5
      Posts
      1080
      Views

      snaders

      @frederik Thanks. Will have a look which type gives the best result. To use the actual font sounds like a good choice though. In Processing (where I made this animation first) I used SVG, but mainly because it's almost impossible to work with type in Processing. Curious which one is faster also.
    • snaders

      UNSOLVED How to load and draw SVG files?
      svg • • snaders  

      5
      0
      Votes
      5
      Posts
      1282
      Views

      gferreira

      @snaders in DrawBot you don’t really resize an image, you change the scale at which it is drawn. (same logic as in Draw a letter within a viewbox) imgPath = 'https://i.ytimg.com/vi/oHg5SJYRHA0/hqdefault.jpg' # get image width & height imgWidth, imgHeight = imageSize(imgPath) # define box width & height boxWidth, boxHeight = 640, 640 # calculate scaling factors factorHeight = boxHeight / imgHeight factorWidth = boxWidth / imgWidth # draw scaled image with savedState(): scale(factorWidth, factorHeight) image(imgPath, (0, 0)) # draw box fill(None) stroke(1, 0, 0) strokeWidth(5) rect(0, 0, boxWidth, boxHeight)
    • snaders

      This topic is deleted!
      • snaders  

      1
      0
      Votes
      1
      Posts
      3
      Views

      No one has replied

    • RafalBuchner

      UNSOLVED Installing Packages
      modules • • RafalBuchner  

      3
      0
      Votes
      3
      Posts
      1014
      Views

      RafalBuchner

      @jo Yes, right now I'm working like that, but I would try to avoid this solution in particular, since I consider it as not Pythonic and "proper"
    • RafalBuchner

      SOLVED Drawing glyphs from ufo file.
      bezierpath pens ufo • • RafalBuchner  

      4
      0
      Votes
      4
      Posts
      1852
      Views

      RafalBuchner

      Delayed, but still: thanks guys !!!
    • Tim

      UNSOLVED Code crashing when using multiprocessing.Pool
      drawbot as module performance • • Tim  

      11
      0
      Votes
      11
      Posts
      3463
      Views

      Tim

      @frederik Sorry for the late reply, I've been on vacation for a while. It's a little rusty after so many days The main focus lays on "main_pool()" "multiprocessing.Pool()" creates, in my 8core case, 8 separate processes (ignore the -1 in the code) Then "p.map()" runs function "run()" 120 times (12 fps times 10 sec. from the settings) but only 8 at one time. As soon as one process is finished it runs the next one. it saves the images separately and can be stitched together into one gif with "exportGif()" More in depth info can be found on: https://docs.python.org/3.4/library/multiprocessing.html My example is only useful if the processes don't have to talk to each other. But on the ref page above should be other examples as well. I'll post the result of my script in a few hours. Well the result in which I've used this method.
    • agyei

      SOLVED Can't import geocoder
      modules • • agyei  

      2
      0
      Votes
      2
      Posts
      980
      Views

      agyei

      I figured out the problem: I was using the wrong version of Python when installing the package. Just so this isn't useless, I used this to help me check if the module was installed and accessible in Drawbot: help("modules")
    • dyb

      SOLVED How to get image DPI?
      image object resolution • • dyb  

      2
      0
      Votes
      2
      Posts
      1013
      Views

      frederik

      good question in drawBot there is not a api for this. I could consider imageResoltion(path) returning the dpi opening an issue: https://github.com/typemytype/drawbot/issues/215
    • MauriceMeilleur

      SOLVED Generate animated .gifs, .pdfs similar to generateMP4()?
      animation animated gif • • MauriceMeilleur  

      5
      0
      Votes
      5
      Posts
      1332
      Views

      frederik

      not really... but this is not so hard with a PDFDocument
    • MauriceMeilleur

      SOLVED A deeper bevel on lineJoin()?
      recreations trigonometry stroke outline • • MauriceMeilleur  

      17
      0
      Votes
      17
      Posts
      3310
      Views

      MauriceMeilleur

      The last thing will be to provide for the case where the points are in a continuous chain, like the <o>. I'm pretty sure I know what to do, and it shouldn't be that hard, but I have some other problems with the Crouwel code to fix first (all to do with graphing and finding valid paths—this whole project is forcing me to teach myself the basics of computer science as I go). I'll post the revised and extended code here when it's done.
    Drawing With Python