Skip to content

Commit

Permalink
Imagix/issue11 (#16)
Browse files Browse the repository at this point in the history
* Also interpret the objects_line_of_sight entries.

* Mark the version as beta

* Also interpret the objects_line_of_sight entries.

* Mark the version as beta

* Remove the beta designation
  • Loading branch information
Imagix committed Aug 26, 2021
1 parent a7daafc commit cc9ede6
Show file tree
Hide file tree
Showing 4 changed files with 290 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -2,7 +2,7 @@
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.
This was last used with Dungeondraft v1.0.2.1 Beta.

## Requirements

Expand Down
248 changes: 246 additions & 2 deletions exampleMaps/sampleMap.dd2vtt

Large diffs are not rendered by default.

41 changes: 36 additions & 5 deletions exampleMaps/sampleMap.dungeondraft_map
Expand Up @@ -130,15 +130,23 @@

]
},
"object_library_memory": null,
"scatter_library_memory": null
"object_library_memory": {
"mode": "all",
"scroll": 938.875,
"selected": [
"res://textures/objects/structures/pillars/pillar_stone_33.png"
],
"search_strictness": 0.5
},
"scatter_library_memory": null,
"sharpen_fonts": true
}
},
"world": {
"format": 3,
"width": 12,
"height": 11,
"next_node_id": "6",
"next_node_id": "8",
"next_prefab_id": "0",
"msi": {
"offset_map_size": 512,
Expand All @@ -158,7 +166,7 @@
"0": {
"label": "Ground",
"environment": {
"baked_lighting": true,
"baked_lighting": false,
"ambient_light": "ffffffff"
},
"layers": {
Expand Down Expand Up @@ -427,7 +435,30 @@

],
"objects": [

{
"position": "Vector2( 1408, 768 )",
"rotation": 0,
"scale": "Vector2( 1, 1 )",
"mirror": false,
"texture": "res://textures/objects/furniture/tables/small_table_04.png",
"layer": 100,
"shadow": true,
"block_light": false,
"custom_color": "ff6b3834",
"node_id": "6"
},
{
"position": "Vector2( 1536, 2304 )",
"rotation": 0,
"scale": "Vector2( 1, 1 )",
"mirror": false,
"texture": "res://textures/objects/structures/pillars/pillar_stone_33.png",
"layer": 100,
"shadow": true,
"block_light": true,
"custom_color": "ff6b3834",
"node_id": "7"
}
],
"lights": [
{
Expand Down
8 changes: 7 additions & 1 deletion uvtt2fgu.py
Expand Up @@ -297,6 +297,12 @@ def composeOccluders(self) -> ET.Element:
for los in self.data['line_of_sight']:
occluders.append(self.composeWall(los))

objectsLoS = self.data.get('objects_line_of_sight', [])

logging.debug(' {} object los elements'.format(len(objectsLoS)))
for los in objectsLoS:
occluders.append(self.composeWall(los))

# Next the portal elements, which may be doors or windows
logging.debug(' {} portal elements'.format(len(self.data['portals'])))
for portal in self.data['portals']:
Expand Down Expand Up @@ -460,7 +466,7 @@ def init_argparse() -> argparse.ArgumentParser:
'-r', '--remove', help='Remove the input dd2vtt file after conversion'
)
parser.add_argument(
'-v', '--version', action='version', version=f'{parser.prog} version 1.2.1'
'-v', '--version', action='version', version=f'{parser.prog} version 1.3.0'
)
parser.add_argument('files', nargs='*',
help='Files to convert to .png + .xml for FGU')
Expand Down

0 comments on commit cc9ede6

Please sign in to comment.