
Updated Thread:
I originally posted this script back in June. At that time, you had to have a running version of PHP locally so that you could parse the SVG file into usable commands. With the advent of Dynamic Light Walls block movement, I've dusted this off and added web hosting of this script so that step 2 is much easier. You'll still need to be able to navigate The GIMP, but I hope my directions below are sufficient for your needs there. I'll try and improve this script in the coming months if there is any interest.
Prerequisites:
- The GIMP for creating and exporting the path SVG file for your map
- Post Processing Website for turning the SVG into commands to setup your walls.
The Basic Process:
- In The GIMP
- Load your map.
- Generate a path for your walls.
- Export your path to a file (SVG).
- On the Post Processing Website
- Upload your SVG file from step 1.3
- Copy the output commands
- In Roll20
- On the map layer, select the image that is your map
- Paste the commands into the chat and send them.
- Wait about a minute (feel free to watch the log, there are status messages so you know it's working).
- Enjoy!
Detailed Instructions:
1. In The GIMP
1. Load your Map
From the menu, select File->Open...Browse to your map and click the Open button.2. Generate a path for your walls and Export your path to a file
There are several ways of doing this, the methods I like best involve selecting an area and turning it into a path. I'll cover two ways of doing that, but feel free to do more advanced things or experiment further.
Click in the output box and copy the generated commands.
Now we'll take those commands to Roll20.
Start by selecting a map token on the map layer. The script will use that map for positioning and scaling. Because the commands all come through as separate api messages, it will have to do all of the work regardless of if you have selected a map, and then tell you afterwards that you didn't, so do yourself a favor and select one now. =D

Paste the commands into the chat and hit enter. You can watch the log file to make sure it's actually doing something.

Depending on the complexity of the Path, it can take a while to run. For the caves in the Magic Wand example above, it took about a minute to parse all the commands. This one took only a few seconds. Here is the view of the Dynamic Lights layer after running the commands. You can see the walls we added in red as well as their effects on the lights.

GitHub: https://github.com/shdwjk/Roll20API/blob/master/W...
2. On the Post Processing Website
Follow the instructions on the website to upload your SVG file and click 'Parse'.Click in the output box and copy the generated commands.
Now we'll take those commands to Roll20.
3. In Roll20
With the Walls Roll20 API script installed, you can add your walls to the map.Start by selecting a map token on the map layer. The script will use that map for positioning and scaling. Because the commands all come through as separate api messages, it will have to do all of the work regardless of if you have selected a map, and then tell you afterwards that you didn't, so do yourself a favor and select one now. =D

Paste the commands into the chat and hit enter. You can watch the log file to make sure it's actually doing something.

Depending on the complexity of the Path, it can take a while to run. For the caves in the Magic Wand example above, it took about a minute to parse all the commands. This one took only a few seconds. Here is the view of the Dynamic Lights layer after running the commands. You can see the walls we added in red as well as their effects on the lights.

4. Enjoy!
Current Limitations:
- Only the SVG commands M, C, and Z are supported. These are the absolute position commands for moving to a point, drawing a curve, and closing a curve. I couldn't actually get The GIMP to export a path with anything but these 3 commands in it, so this is only a limitation if you are coming from some other source. If other commands become necessary, I'm happy to add them in. PM me with details if you need this.
- No support for Rotation, Flip Horizontal, Flip Vertical. If you need these operations, you're either on your own with adjusting the paths afterwards, or you need to do them in TheGIMP and then export the path.
Future Features:
- Support for Rotation -- this won't be terribly difficult, let me know if you need it and I'll prioritize it.
- Support for Flip Horizontal and Flip Vertical -- Also not too difficult
- Support for generating smaller path segments to allow post import customization.
- Support for applying a loaded path to a map if you forgot to select one.
- Support for color selection and stroke size.
GitHub: https://github.com/shdwjk/Roll20API/blob/master/W...
If you use my scripts, want to contribute, and have the spare bucks to do so, go right ahead. However, please don't feel like you must contribute just to use them! I'd much rather have happy Roll20 users armed with my scripts than people not using them out of some sense of shame. Use them and be happy, completely guilt-free!
Disclaimer: This Patreon campaign is not affiliated with Roll20; as such, contributions are voluntary and Roll20 cannot provide support or refunds for contributions.