Utility to extract Fantasy Grounds Unity Line-of-sight and lighting files from a Univeral VTT file exported from Dungeondraft

Overview

uvtt2fgu

Utility to extract Fantasy Grounds Unity Line-of-sight and lighting files from a Univeral VTT file exported from Dungeondraft

This program works with Fantasy Grounds Unity v4.1 or higher as that is the version where dynamic lighting effects were added. This was last used with Dungeondraft v1.0.1.3.

Requirements

uvtt2fgu.py requires a python3 installation with PIP.

Usage

  1. Create your map in Dungeondraft
  2. Export the map in Universal VTT format
    • You do not have to use the default "Best Quality" Grid Preset. You could use the "Roll20" setting as this will make the image files smaller. Remember that your players will need to download these images via FGU. The .jpg is also smaller than the .png. The pixel count is encoded in the exported file and will be correctly set up in FGU when imported.
    • You should turn off Lighting as you want FGU to draw the lighting effects and not have the underlying image with the lighting
    • You should turn off the Grid as well. The grid size will be correctly set up in FGU so you should only need to turn it on within FGU.
    • These are both "should"s and not "must"s. If you want your image to have the lighting drawn on it and/or the grid, it won't break anything.
  3. Run the script as uvtt2fgu.py sampleMap.dd2vtt. This will emit sampleMap.png, sampleMap.jpg, and sampleMap.xml into your current directory
  4. Copy the sampleMap.xml file into your campaign's images directory
  5. Import the .png or .jpg in FGU

Configuration File

The configuration file is a standard .INI format file. All of the configuration lives in a "[default]" section. This file is found In various places:

Platform Location
Windows %APPDATA%\uvtt2fgu\uvtt2fgu.conf
Mac OS $HOME/Library/Preferences/uvtt2fgu/uvtt2fgu.conf
Linux $XDG_CONFIG_HOME/uvtt2fgu.conf
$HOME/.config/uvtt2fgu.conf

The file named in the -c command-line parameter overrides this search. For Linux, it uses the XDG_CONFIG_HOME version if that environment variable is set, otherwise use the $HOME version.

Example configuration file:

[default]
xmlpath=/home/joesmith/.smiteworks/fgdata/campaigns/TestLight/images
writepng=False
jpgpath=out
force=True

This file will cause the program to write the xml file directly out to joesmith's FGU TestLight campaign's images folder. It will write the jpg to the "out" subdirectory of where the script is run. It will overwrite the xml and jpg files if they exist. It will not write out the png file.

Configuration file parameters

Parameter Description Default
alllocaldd2vttfiles If no files are specified, look for all .dd2vtt files in the current directory and convert them False
force Force overwrite destination files False
jpgpath Path where the .jpg file will be written Current working directory
pngpath Path where the .png file will be written Current working directory
remove Remove the source file after conversion False
writejpg Write the .jpg file True
writepng Write the .png file True
xmlpath Path where the .xml file will be written Current working directory

Command-line

usage: uvtt2fgu.py [OPTIONS] [FILES]

Convert Dungeondraft .dd2vtt files to .jpg/.png/.xml for Fantasy Grounds Unity
(FGU)

positional arguments:
  files                 Files to convert to .png + .xml for FGU

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        Configuration file
  -f, --force           Force overwrite destination files
  -l {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --log {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Set the logging level
  -o OUTPUT, --output OUTPUT
                        Path to the output directory
  --portalwidth PORTALWIDTH
                        Width of portals
  --portallength PORTALLENGTH
                        Additional length to add to portals
  -r REMOVE, --remove REMOVE
                        Remove the input dd2vtt file after conversion
  -v, --version         show program's version number and exit

Parameters specified on the command-line will supersede parameters specified in the configuration file.

By default, the program will not overwrite destination files. You can use -f to force it to overwrite.

By default, the files are all written into your current directory. You can use -o /otherdir to have the files written into /otherdir.

--portalwidth sets how wide the FGU portals will be. This is specified either as a percentage of a grid width, or as a specific number of pixels. Either --portalwidth 36% or --portalwidth 40px. The default is 25%.

--portallength sets how much extra length for the portals. This is specified just like --portalwidth. The default is 0px.

Acknowledgements

Dungeondraft is a map drawing tool. Dungeondraft is produced by Megasploot.

Fantasy Grounds Unity is a Virtual TableTop program for playing many different table-top Role Playing Games (TTRPG), virtually. FGU is produced by SmiteWorks USA LLC.

uvtt2vtt.py is not endorsed by either of these companies, it is a community-effort to make these two programs interoperable.

Comments
  • Broken LoS when using uvtt2fgu on larger file

    Broken LoS when using uvtt2fgu on larger file

    LoS feature itself works fine, but players can move through walls (with spamming key presses or dragging their token). Will assume problem is tied with file size.

    Added the file in drive: https://drive.google.com/file/d/1O4fVdVbCiOWn12kd1o_WNeLmTiky0umE/view?usp=sharing

    Reference to forum: https://www.fantasygrounds.com/forums/showthread.php?69484-Player-token-moving-through-walls

    invalid 
    opened by Mankomancer 16
  • FA Asset Pack - Door Frame Issue

    FA Asset Pack - Door Frame Issue

    Hey there, thank you for this export. I am just getting into DD and working on a project and came across something that you may or may not have the ability to do anything about. But maybe we can get something changed.

    In the Forgotten Adventures asset pack, there is door frames that can be placed separately from doors. They are in the portal tool, so you end up with in effect, two doors. I endedup remaking my map to not use them but would love to see support for door frames.

    Anything I can do to help let me know.

    Thanks

    invalid 
    opened by rpclarke 10
  • Suggestion: run on directory using config file

    Suggestion: run on directory using config file

    Keep it command-line only and operating system agnostic Allow a configuration file to be specified ( -c , or look for a default "uvtt2fgu.yaml") Config file specifies

    • source directory (default pwd)
    • img output directory (default pwd)
    • xml output directory (default pwd)

    Runs over all .dd2vtt files and convert them Default to check modified dates on output files to determine whether to overwrite them Force (-f) overrides modified check Add a remove (-r) option that removes the .dd2vtt file once processed

    Reasoning: Can put the executable or script file in a directory and run it with a click. Can export all .dd2vtt files into a single folder and then run the script to process changed ones. With a cron job you could set up a "process queue" folder, using the -r parameter to keep the folder clean

    enhancement 
    opened by alexstreit 8
  • something wrong with the latest version of dungeondraft 1.0.1.3

    something wrong with the latest version of dungeondraft 1.0.1.3

    When i create a simple figure with some walls and maps the image is not at the same place than the walls and lights. I haven't that problem with 1.0.1.1. Thanks. FantasyGrounds_Mg5wFa1vx0 FantasyGrounds_MPVI3BX4p5

    bug 
    opened by chalard87 7
  • add jpeg quality options

    add jpeg quality options

    The default Pillow jpeg settings default to quality 75 and don't use the optimize setting. This PR adds the defaults

            self.jpgQuality = 90
            self.jpgOptimize = True
            self.jpgSubsampling = 2
    

    which results in the following improvements:

    Original: original

    With higher quality settings: higher quality

    Obviously this does increase file sizes; so I've added this as configuration that can be overridden if the user wishes.

    enhancement 
    opened by matjam 4
  • Make object LoS blockers terrain blockers instead of hard walls

    Make object LoS blockers terrain blockers instead of hard walls

    From the FGU forums: https://www.fantasygrounds.com/forums/showthread.php?68774-A-new-Dungeondraft-to-Fantasy-Grounds-Unity-conversion-tool&p=621360#post621360

    I don't know if you can differentiate types of vision blocks, but if you enable vision blocking for an object within Dungeondraft, the resulting object gets a hard wall where a terrain wall would be more suitable because the players can't see the object within the wall otherwise.

    enhancement 
    opened by Imagix 2
  • lazy conf generates error and escapes script.

    lazy conf generates error and escapes script.

    Love the script Imagix, use this for tons of my Sunday games.

    I was working with getting a JPG/XML export setup in the .conf file set in &Appdata& and the script generated a 0kb jpg with no xml.

    With the conf file:

    [default]
    xmlpath=!PATH!\ExportedMaps
    writepng=False
    jpgpath=!PATH!\ExportedMaps
    
    #jpgQuality=75
    #jpgSubsampling=2
    #jpgOptimize=True
    
    force=True
    ``
    --CMD--
    PS !PATH!> ./uvtt2fgu.exe ./SuperCave.dd2vtt
    Traceback (most recent call last):
      File "uvtt2fgu.py", line 617, in <module>
      File "uvtt2fgu.py", line 611, in main
      File "uvtt2fgu.py", line 451, in processFile
      File "uvtt2fgu.py", line 418, in writeJpg
      File "PIL\Image.py", line 2172, in save
      File "PIL\JpegImagePlugin.py", line 655, in _save
    ValueError: Invalid quality setting
    [23088] Failed to execute script uvtt2fgu
    ----
    

    The error is generated and just the 0kb jpg exists. The error can be avoided by removing the comments in the above. However I wouldn't expect that I have to set those flags as those are the default values that are used without a config.

    bug 
    opened by kanbie 1
  • Jpg quality adjustments

    Jpg quality adjustments

    The underlying jpg library has some additional controls that can adjust the quality of the jpg generated. Provide configuration parameters to allow them to be used.

    enhancement 
    opened by Imagix 1
  • lazy conf generates error and escapes script.

    lazy conf generates error and escapes script.

    Fixes #25

    The code retrieving the data from the config file wasn't defaulting to valid values, but would default to None, causing errors later. Specifying the three configuration parameters manually would workaround the issue.

    opened by Imagix 0
  • Fails to output map if the resultant map is too large

    Fails to output map if the resultant map is too large

    Attempting to convert a dd2vtt file with too large of an image file may result in an error message such as: PIL.Image.DecompressionBombError: Image size (458752000 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack.

    There should be a command-line parameter/config file parameter for changing this limit.

    enhancement 
    opened by Imagix 0
  • Pixel coordinates should be rounded to 1 decimal place

    Pixel coordinates should be rounded to 1 decimal place

    According to Smiteworks, the pixel coordinate values are floating point, but are only supposed to be 1 decimal point of precision (as opposed to whatever a float can do).

    bug 
    opened by Imagix 0
Releases(v1.5.1)
Owner
Andre Kostur
Andre Kostur
Various importers for cointracker

cointracker_importers Various importers for cointracker To convert nexo .csv format to cointracker .csv format: Download nexo csv file. run python Nex

Stefanos Anastasiou 9 Oct 24, 2022
API Rate Limit Decorator

ratelimit APIs are a very common way to interact with web services. As the need to consume data grows, so does the number of API calls necessary to re

Tomas Basham 575 Jan 05, 2023
Finds price floor for every single attribute in a given collection

Solana Solanart Scanner Enjoy the Free Code Steps to run Download VS Code

Dalton Nisbett 19 Oct 20, 2022
Dill_tils is a package that has my commonly used functions inside it for ease of use.

DilllonB07 Utilities Dill_tils is a package that has my commonly used functions inside it for ease of use. Installation Anyone can use this package by

Dillon Barnes 2 Dec 05, 2021
A simple dork generator written in python that outputs dorks with the domain extensions you enter

Dork Gen A simple dork generator written in python that outputs dorks with the domain extensions you enter in a ".txt file". Usage The code is pretty

Z3NToX 4 Oct 30, 2022
UUID version 7, which are time-sortable (following the Peabody RFC4122 draft)

uuid7 - time-sortable UUIDs This module implements the version 7 UUIDs, proposed by Peabody and Davis in https://www.ietf.org/id/draft-peabody-dispatc

Steve Simmons 22 Dec 20, 2022
Tool for generating Memory.scan() compatible instruction search patterns

scanpat Tool for generating Frida Memory.scan() compatible instruction search patterns. Powered by r2. Examples $ ./scanpat.py arm.ks:64 'sub sp, sp,

Ole André Vadla Ravnås 13 Sep 19, 2022
A hashtag from string extract python module

A hashtag from string extract python module

Fayas Noushad 3 Aug 10, 2022
An OData v4 query parser and transpiler for Python

odata-query is a library that parses OData v4 filter strings, and can convert them to other forms such as Django Queries, SQLAlchemy Queries, or just plain SQL.

Gorilla 39 Jan 05, 2023
Kanye West Lyrics Generator

aikanye Kanye West Lyrics Generator Python script for generating Kanye West lyrics Put kanye.txt in the same folder as the python script and run "pyth

4 Jan 21, 2022
A simple python script to generate an iCalendar file for the university classes.

iCal Generator This is a simple python script to generate an iCalendar file for the university classes. Installation Clone the repository git clone ht

Foad Rashidi 2 Sep 01, 2022
Fcpy: A Python package for high performance, fast convergence and high precision numerical fractional calculus computing.

Fcpy: A Python package for high performance, fast convergence and high precision numerical fractional calculus computing.

SciFracX 1 Mar 23, 2022
A primitive Python wrapper around the Gromacs tools.

README: GromacsWrapper A primitive Python wrapper around the Gromacs tools. The library is tested with GROMACS 4.6.5, 2018.x, 2019.x, 2020.x, and 2021

Becksteinlab 140 Dec 28, 2022
Simple Python tool that generates a pseudo-random password with numbers, letters, and special characters in accordance with password policy best practices.

Simple Python tool that generates a pseudo-random password with numbers, letters, and special characters in accordance with password policy best practices.

Joe Helle 7 Mar 25, 2022
Generate random german words

Generate random german words / Generiere zufällige deutsche Wörter Getting Started Pip install with pip install zufallsworte Install the library with

Maximilian Freitag 5 Mar 24, 2022
Experimental python optimistic rollup fraud-proof generation

Macula Experimental python optimistic rollup fraud-proof generation tech by @protolambda. Working on a python version for brevity and simplicity. See

Diederik Loerakker 30 Sep 01, 2022
A library to easily convert climbing route grades between different grading systems.

pyclimb A library to easily convert climbing route grades between different grading systems. In rock climbing, mountaineering, and other climbing disc

Ilias Antonopoulos 4 Jan 26, 2022
A simple gpsd client and python library.

gpsdclient A small and simple gpsd client and library Installation Needs Python 3 (no other dependencies). If you want to use the library, use pip: pi

Thomas Feldmann 33 Nov 24, 2022
Data Utilities e.g. for importing files to onetask

Use this repository to easily convert your source files (csv, txt, excel, json, html) into record-oriented JSON files that can be uploaded into onetask.

onetask.ai 1 Jul 18, 2022
Brainfuck rollup scaling experiment for fun

Optimistic Brainfuck Ever wanted to run Brainfuck on ethereum? Don't ask, now you can! And at a fraction of the cost, thanks to optimistic rollup tech

Diederik Loerakker 48 Dec 28, 2022