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
A simple API that will return a key-value pair of randomly generated UUID

A simple API that will return a key-value pair of randomly generated UUID. Key will be a timestamp and value will be UUID. While the server is running, whenever the API is called, it should return al

Pius Lucky 2 Jan 18, 2022
🍰 ConnectMP - An easy and efficient way to share data between Processes in Python.

ConnectMP - Taking Multi-Process Data Sharing to the moon 🚀 Contribute · Community · Documentation 🎫 Introduction : 🍤 ConnectMP is the easiest and

Aiden Ellis 1 Dec 24, 2021
Python implementation of Gorilla time series compression

Gorilla Time Series Compression This is an implementation (with some adaptations) of the compression algorithm described in section 4.1 (Time series c

Ghiles Meddour 19 Jan 01, 2023
Skywater 130nm Klayout Device Generators PDK

Skywaters 130nm Technology for KLayout Device Generators Mabrains is excited to share with you our Device Generator Library for Skywater 130nm PDK. It

Mabrains 18 Dec 14, 2022
The git for the Python Story Utility Package library.

SUP The git for the Python Story Utility Package library. Installation: Install SUP by simply running pip install psup in your terminal. Check out our

Enoki 6 Nov 27, 2022
Find unused resource keys in properties files in a Salesforce Commerce Cloud project and get rid of them.

Find Unused Resource Keys Find unused resource keys in properties files in a Salesforce Commerce Cloud project and get rid of them. It looks through a

Noël 5 Jan 08, 2022
Random Number Generator Analysis With Python

Random-Number-Generator-Analysis Governor's Honors Program Project to determine

Jack Prewitt 2 Jan 23, 2022
A Python package implementing various colour checker detection algorithms and related utilities.

A Python package implementing various colour checker detection algorithms and related utilities.

colour-science 147 Dec 29, 2022
Lock files using python and cmd

Python_Lock_Files Lock files using python and cmd license feel free to do whatever you want to with these files, i dont take any responsibility tho, u

1 Nov 01, 2021
Allows you to canibalize methods from classes effectively implementing trait-oriented programming

About This package enables code reuse in non-inheritance way from existing classes, effectively implementing traits-oriented programming pattern. Stor

1 Dec 13, 2021
This repository contains scripts that help you validate QR codes.

Validation tools This repository contains scripts that help you validate QR codes. It's hacky, and a warning for Apple Silicon users: the dependencies

Ryan Barrett 8 Mar 01, 2022
async parser for JET

This project is mainly aims to provide an async parsing option for NTDS.dit database file for obtaining user secrets.

15 Mar 08, 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
Utility to play with ADCS, allows to request tickets and collect information about related objects.

certi Utility to play with ADCS, allows to request tickets and collect information about related objects. Basically, it's the impacket copy of Certify

Eloy 185 Dec 29, 2022
A monitor than send discord webhook when a specific monitored product has stock in your nearby pickup stores.

Welcome to Apple In-store Monitor This is a monitor that are not fully scaled, and might still have some bugs.

5 Jun 16, 2022
PyHook is an offensive API hooking tool written in python designed to catch various credentials within the API call.

PyHook is the python implementation of my SharpHook project, It uses various API hooks in order to give us the desired credentials. PyHook Uses

Ilan Kalendarov 158 Dec 22, 2022
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
Implementing C++ Semantics in Python

Implementing C++ Semantics in Python

Tamir Bahar 7 May 18, 2022
Simple script to export contacts from telegram into vCard file

Telegram Contacts Exporter Simple script to export contacts from telegram into vCard file Getting Started Prerequisites You must to put your Telegram

Pere Antoni 1 Oct 17, 2021
Automatic generator of readmes for git repositories (Includes file' listing)

Readme Generator We are bored of write the same things once and once again. We trust in the comments made inside of our files, and we decided to autom

Natalia Vera Duran 6 Jul 20, 2021