Author Topic: Relative Paths  (Read 445 times)

0 Members and 1 Guest are viewing this topic.

hogjonny

  • World Machine Veteran
  • ***
  • Posts: 42
  • Work hard, so you can play harder.
    • View Profile
    • bit-slap.me
Relative Paths
« on: May 10, 2017, 03:22:29 PM »
Relative Paths don't always work the way I would expect them to...

Consider this situation:
- I want to use a Sand world, but then use it in several other worlds
- I want a Rocky world that also uses Sand
- I want an Island world that also uses Sand

I have two separate setups for folder structure that I tried.

{one} - This one is more flexible and ideal for modularity

My Depo:
C:\Dev\WorldMachine

My Rocky World
C:\Dev\WorldMachine\WorldA\worldA.tmd

My Sand
C:\Dev\WorldMachine\WorldB\output\height.tif

In WorldA, I want to use and output from WorldB ...
  • when I use a input node, and point it to the height.tif from WorldB I get an absolute path:
  • C:\dev\worldmachine\WorldB\input_maps\height.tif

What I would expect as a relative path:  ..\..\WorldB\output\height.tif

Relative paths can usually be up and down the filetree?

{two} - this one allows for downstream cascading only, far less modular

C:\Dev\WorldMachine
C:\Dev\WorldMachine\Composite\WorldA
C:\Dev\WorldMachine\Composite\WorldA\WorldB\output\height.tif

In WorldA, I want to use and output from WorldB ...
  • when I use a input node, and point it to the height.tif from WorldB I DO get a downstream relative path:
  • WorldB\output\height.tif

There are a couple of issues and problems with this workflow,if you are trying to build modular and automate world building:
  • Data portability:  If I copied the c:\dev\worldmachine folder to another drive like D: the path is no longer valid, as it's absolute instead of relative.  Think build machines, source control, multiple users, workspaces and depot mapping ... this will eventually be encountered.
  • Modularity:  I have to always order reuse in a downstream way.  Eventually this will be a mess and become inflexible.
skype: hogjonny

hogjonny

  • World Machine Veteran
  • ***
  • Posts: 42
  • Work hard, so you can play harder.
    • View Profile
    • bit-slap.me
Re: Relative Paths
« Reply #1 on: May 10, 2017, 03:51:27 PM »
So there is one 'half measure' around this ...

In each world machine .tmd, you can go into the Project Settings and change: 'Default Relative Path'

I set it too:
    C:\dev\worldmachine\

Now, if I go back and reload the height map input, I get a relative path (downstream from this new root):
    WorldB\input_maps\height.tif

Of course, I've mitigated some concern for modularity if I change this root far enough back (to a common root) in each world file.

But, I still have the issue of data portability and a depot would still need to be mapped to the same drive and location for every user and build machine working in the project.

skype: hogjonny