Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Author Topic: Absolute file name for materials  (Read 5053 times)

camille.rufu

  • Newbie
  • *
  • Posts: 3
    • View Profile
Absolute file name for materials
« on: April 01, 2015, 04:07:26 am »

Hello,
Is there a way to have relative file names for materials instead absolute ones ?  Even modified in text file (replace by .\\xxx), Animator renamed it...
Best regards.
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Absolute file name for materials
« Reply #1 on: April 01, 2015, 06:56:17 am »

Not sure which version of Anim8or you're using but if you're using the latest development release...

If you have just a '.' in File->Configure for the texture directory, then it checks the original absolute directory, and it searches the directory that the .an8 file is located in and its subdirectories. If you have a texture directory specified in File->Configure, then it'll only do the search in that specified directory and it'll search in the root directory that the .an8 file is located in (no subdirectories). So if you want to be absolutely safe when transporting/packaging your files, you can keep all the textures in the same directory as the .an8 file (not in any subdirectories), and it'll load it even if the user specified a texture directory in their configuration.
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2126
    • View Profile
Re: Absolute file name for materials
« Reply #2 on: April 01, 2015, 12:53:22 pm »

Here's how Anim8or searches for texture files:

$FILENAME = ($DIR, $ROOT, $EXT), i.e. for

D:\user\steve\mytextures\bricks.png

$DIR = "D:\user\steve\mytextures\",
$ROOT = "bricks", and
$EXT = ".png"

$PROJECT_DIR = directory that the project file is in.
$TEXTURE_DIR = texture directory (see File->Configure dialog)

1. $PROJECT_DIR + $ROOT + $EXT
2. $TEXTURE_DIR + $ROOT + $EXT
3. $FILENAME_DIR + $ROOT + $EXT -- uses absolute path in specified file name
4. Searching sub-directories of texture directory: $TEXTURE_DIR/*/ + $ROOT + $EXT

I had thought about swapping the order of #3 and #4.  It can be a paint when the absolute $FILENAME is on a drive that doesn't exist (such as when you download a project from some other computer) so I moved it later in the list. The is especially true for if the device is a CD drive on your local computer.
Logged