Author Topic: File Portability - Relative Paths  (Read 2973 times)

Offline markrvp

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • My YouTube Channel
File Portability - Relative Paths
« on: August 03, 2016, 03:39:15 PM »
Is there, or would there be, a way to make the path to the images directory for a sequence relative as opposed to absolute?

For example, If my friend shares a file with me that has a lot of images, the XML file lists the image directory as the one on his computer where he created the sequence.  I need to edit the XML file to change the image filepath to the location on my computer.

Is there a way for xLights to check a relative path?  Like say, a folder called IMAGES in the same directory as the sequence XML file?


Offline flyinverted

  • Administrator
  • Hero Member
  • *****
  • Posts: 756
    • View Profile
Re: File Portability - Relative Paths
« Reply #1 on: August 03, 2016, 03:54:19 PM »
That would probably mess up a lot of people's sequences.  There once was a forced place all media (same as show folder) due to user requests this changed.

It is very simple to search and replace in a text file. It's even easier to just create a folder on your system that matches the path of the source file.

I would not want xlights to search for a path on my system because I may have files that match the file name needed but in fact those are not the correct files.
 
Just my thoughts,
Steve
Steve Giron
Maricopa County, AZ
xLights user with a boat-load of channels.

Do not ask to know all the answers, but ask to understand the question.

Offline markrvp

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • My YouTube Channel
Re: File Portability - Relative Paths
« Reply #2 on: August 03, 2016, 04:02:39 PM »
That would probably mess up a lot of people's sequences.  There once was a forced place all media (same as show folder) due to user requests this changed.

It is very simple to search and replace in a text file. It's even easier to just create a folder on your system that matches the path of the source file.

I would not want xlights to search for a path on my system because I may have files that match the file name needed but in fact those are not the correct files.
 
Just my thoughts,
Steve

Yeah, I completely understand and respect your position.  If there were a way to keep both absolute and relative filepaths that would be great.

A friend of mine and I have been trying to help some people get sequences shared and working.  We don't want to have to do all the work.  Some people just aren't savvy enough to do this.  Others can't/won't put in the time to figure it out.  But it's hard to tell them that when they've dumped a few thousand on lights :(

It's easy for me to copy/replace file paths in Notepad++ because I do it a bunch... I think we as a group underestimate how difficult it is for people to do something that they've never done before.  What is "easy" to us is terrifying to a lot of people.  I just presented two sessions at the Holiday Academy, one of them on power injection.  Most people have a really hard time grasping what are really simple concepts because they are "scary."
« Last Edit: August 03, 2016, 04:04:13 PM by markrvp »

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: File Portability - Relative Paths
« Reply #3 on: August 03, 2016, 04:23:47 PM »
I think Keith changed it so it already makes an attempt to find the file but it might only look in the current show directory when its not found at the hard-coded path.  That didn't work for me cause I like to keep my images in a sub-directory below the show directory.  I'd like it to at least do a recursive search below the show directory.

Offline jnealand

  • Hero Member
  • *****
  • Posts: 1421
    • View Profile
Re: File Portability - Relative Paths
« Reply #4 on: August 03, 2016, 05:41:42 PM »
I think Keith changed it so it already makes an attempt to find the file but it might only look in the current show directory when its not found at the hard-coded path.  That didn't work for me cause I like to keep my images in a sub-directory below the show directory.  I'd like it to at least do a recursive search below the show directory.

+1 for the show directory and anything below the show directory.  Stay away from the computer hard drive as a whole.
Jim Nealand
Kennesaw, GA

Offline keithsw1111

  • Administrator
  • Hero Member
  • *****
  • Posts: 2733
    • View Profile
    • Kellyville Christmas Lights
Re: File Portability - Relative Paths
« Reply #5 on: August 03, 2016, 06:23:19 PM »
It already does this with one caveat. The folder in which the rgbeffects file is stored must be the same name on both machines. All assets should be in this folder or a sub folder. If it doesn't work for you send us the log as it logs the fixups so we can see where it might be failing.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: File Portability - Relative Paths
« Reply #6 on: August 03, 2016, 09:12:01 PM »
Yeah but that's only good for the same user copying his own sequences to another computer.  Like when I pull in Logan's Star Wars sequence into my show folder all his images for the Pictures effect are named like "C:\xLights\Users\logan\Purple man jump.gif" and my show directory might be "C:\xLights\2016\Christmas" and I want to put all the images in "C:\xLights\2016\Christmas\images" whereas he polluted his show directory with all the images.

Offline keithsw1111

  • Administrator
  • Hero Member
  • *****
  • Posts: 2733
    • View Profile
    • Kellyville Christmas Lights
Re: File Portability - Relative Paths
« Reply #7 on: August 03, 2016, 10:33:56 PM »
That's true. We can't solve all the worlds problems :)

Offline bravado67

  • Sr. Member
  • ****
  • Posts: 402
    • View Profile
Re: File Portability - Relative Paths
« Reply #8 on: August 03, 2016, 11:31:37 PM »
Maybe my mapping service will pay off. LOL I can see this as a problem with a lot of art but it shouldn't take long to remap artwork for images. However,  my Thriller Halloween sequence has a lot of video sections from the same video but different start points.

Sent from my SM-G920V using Tapatalk


Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: File Portability - Relative Paths
« Reply #9 on: August 04, 2016, 08:16:12 AM »
That's true. We can't solve all the worlds problems :)

Yeah but fortunately I can solve that one.

Offline dmpeaceman

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: File Portability - Relative Paths
« Reply #10 on: November 04, 2016, 09:11:48 AM »
+1   I came here to post this same enhancement request.

Here's my use-case:

I have a PC at home, and a MAC at work.  I use GIT to store all my files.  When I'm done sequencing at home, I push my changes.  I pull them at work, and can sequence in my down time at the office on my mac.  But first, I have to update all the paths.  Same thing when I get back home.  Not the end of the world - just a minor pain in the rear.

I would prefer that image paths can either be absolute, or relative to the show directory.

In my case, I have an images subdirectory.  So all my image paths would be "images/filename.png", and then going back and forth from work to home shouldn't require any "fixes". 

Also, since PC uses back slashes, and Mac uses forward slashes.  When I "open" a sequence, it should also swap the slashiness for all the filepaths automagically!  :-P

This would be a big time saver for me!