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
Python program for Linux users to change any url to any domain name they want.

URLMask Python program for Linux users to change a URL to ANY domain. A program than can take any url and mask it to any domain name you like. E.g. ne

2 Jun 20, 2022
Genart - Generate random art to sell as nfts

Genart - Generate random art to sell as nfts Usage git clone

Will 13 Mar 17, 2022
A Randomizer Oracle

Tezos Randomizer Tezod Randomizer "Oracle". It's a smart contract that you can call to get a random number between X and Y (for now). It uses entropy

Asbjorn Enge 19 Sep 13, 2022
A tiny Python library for generating public IDs from integers

pids Create short public identifiers based on integer IDs. Installation pip install pids Usage from pids import pid public_id = pid.from_int(1234) #

Simon Willison 7 Nov 11, 2021
jsoooooooon derulo - Make sure your 'jason derulo' is featured as the first part of your json data

jsonderulo Make sure your 'jason derulo' is featured as the first part of your json data Install: # python pip install jsonderulo poetry add jsonderul

jesse 3 Sep 13, 2021
Toolkit for collecting and applying templates of prompting instances

PromptSource Toolkit for collecting and applying templates of prompting instances. WIP Setup Download the repo Navigate to root directory of the repo

BigScience Workshop 1k Jan 05, 2023
Python script to launch burp scans automatically

SimpleAutoBurp Python script that takes a config.json file as config and uses Burp Suite Pro to scan a list of websites.

Adan Álvarez 26 Jul 18, 2022
Generates a random prnt.sc link and display image.

Generates a random prnt.sc link and display image.

Emirhan 3 Oct 08, 2021
This is a tool to calculate a resulting color of the alpha blending process.

blec: alpha blending calculator This is a tool to calculate a resulting color of the alpha blending process. A gamma correction is enabled and the def

Igor Mikushkin 12 Sep 07, 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
Package that allows for validate and sanitize of string values.

py.validator A library of string validators and sanitizers Insipired by validator.js Strings only This library validates and sanitizes strings only. P

Sanel Hadzini 22 Nov 08, 2022
Password generator

Password generator technologies used What is? It is Password generator How to Download? Download on releases Clone repo git clone https://github.com/m

Miek 1 Nov 02, 2021
A clock app, which helps you with routine tasks.

Clock This app helps you with routine tasks. Alarm Clock Timer Stop Watch World Time (Which city you want) About me Full name: Matin Ardestani Age: 14

Matin Ardestani 13 Jul 30, 2022
A dictionary that can be flattened and re-inflated

deflatable-dict A dictionary that can be flattened and re-inflated. Particularly useful if you're interacting with yaml, for example. Installation wit

Lucas Sargent 2 Oct 18, 2021
Small Python script to parse endlessh's output and print some neat statistics

endlessh_parser endlessh_parser is a small Python script that parses endlessh's output and prints some neat statistics about it Usage Install all the

ManicRobot 1 Oct 18, 2021
A Tool that provides automatic kerning for ligature based OpenType fonts in Microsoft Volt

Kerning A Tool that provides automatic kerning for ligature based OpenType fonts in Microsoft Volt There are three stages of the algorithm. The first

Sayed Zeeshan Asghar 6 Aug 01, 2022
Script for generating Hearthstone card spoilers & checklists

This is a script for generating text spoilers and set checklists for Hearthstone. Installation & Running Python 3.6 or higher is required. Copy/clone

John T. Wodder II 1 Oct 11, 2022
Python script to get some stats on nodes in a Blender material nodetree

Python script to get some stats on nodes in a Blender material nodetree. It counts the nodes, the node types and the max deep level for group nodes.

Alek Mugnozzo 2 Sep 03, 2022
Program to extract signatures from documents.

Extracting Signatures from Bank Checks Introduction Ahmed et al. [1] suggest a connected components-based method for segmenting signatures in document

Muhammad Saif Ullah Khan 9 Jan 26, 2022
Spacegit is a .git exposed finder

Spacegit Spacegit is a basic .git exposed finder Usage: You need python3 installed to run spacegit use: python3 spacegit.py (url) Disclaimer: **This i

2 Nov 30, 2021