Relative Path and Absolute Path issues

mayanim8
Advocate
Advocate

Relative Path and Absolute Path issues

mayanim8
Advocate
Advocate

Hello,

 

I am hoping someone can assist me.

Up until recently, the method for creating relative paths was quite strait forward.  Unfortunately, something seems to have changed and I have not been able to figure how to set relative paths for textures.

 

Here is the issue.

When first working on a file,  people start working from a network drive or an external hard drive.  As they progress through modelling to texturing, they discover that things are slowing down.

In the past, they could simply copy the project to their desk top and set the paths for their textures to be relative.  However, the method previously used does not appear to work.

I have attempted to:

Use the file editor and trying to point the files to the new location.

Using the method of going into the hypershade > Set project method.

The path stays linked to the network drive.

The only method that seems to work is manually going through and setting the new path.

 

I am hoping that there is some kind of setting in the preferences that can assist?

 

thank you

 

 

0 Likes
Reply
Accepted solutions (1)
17,683 Views
9 Replies
Replies (9)

sean.heasley
Alumni
Alumni

Hi @mayanim8 

 

What version of Maya are you working with and is it up to date?

 

I don't recall any major changes to how relative paths are set up but you can check out this article that we have for managing file paths in 2019.

 

 

0 Likes

mspeer
Consultant
Consultant

Hi!

 

@mayanim8  and @sean.heasley 

As long as the absolute file path is available it will be preferred over the local path.

This can easily be verified by renaming the "old" project folder,

after this Maya uses the local path.

There may be situations where this is useful, however as Maya should be used with the project folder workflow i don't know why the absolute path of a scene-file is checked and used first.

0 Likes

mayanim8
Advocate
Advocate

Thank you for responding.

I am using Maya 2018

I'm not really sure I understand.

I'm including a screen grab showing the issues I seem to be having.

In this example the project was first created with the project on a network, however, the file no longer exists in the original location.

The project was copied in whole and relocated.

When the file is opened, the textures appear to work.  If I reload the image, it is looking to the new project.  However if I attempt to render, edit or view the image in the Attribute Editor, I get an error.  Maya is still looking to the old address.

Even after I run the Repath Files, the files address in the Attribute Editor still is looking to a location that no longer exists.

Back in earlier versions of Maya, you could create paths using via the Hypershade.  However, when I try to follow this method, the results are not the same.  The file is still pointing to original address rather than a relative path.

Thank you

0 Likes

mspeer
Consultant
Consultant

Hi!

No problem here with Maya 2018.5 and Maya 2019.1 .

Please check your Maya version and update if necessary.

0 Likes

mayanim8
Advocate
Advocate

Thank you for responding.
I have upgraded Maya to 2019.
Maya has the default prefs

I have reviewed the notes regarding File Path management. I have used it and it has been very helpful.
However, even when doing so, the path of the file is not truly relative.
As well after I run the re path, I am still unable to edit or view the image through the Attribute Editor.
If I manually replace the address with ".\" such as: .\sourceimages\woodWall_colour.png , I am then able to view the image.

In recent versions of Maya (2017), one could do this using the Hypershade, selecting textures and then setting the project. The textures would then have relative paths.
This old Autodesk Tutorial describes what I am asking: https://area.autodesk.com/blogs/the-maya-blog/test/


I realise this is an old tool and it is no longer available, however, the functionality had been moved to the Hypershade.  As described in this tutorial:  https://www.youtube.com/watch?v=Dw3d-afB2Q8

This method, no longer appears to work.

As a result, to ensure that a path is a true relative path, I now need to go back to the tedious method of manually typing in a ".\" in front of sourceimages for every file.

 

So the question is, has the ability to create a Maya scene file that has permanent relative paths automatically been removed?  If this function is still available, may I ask how to do it?

Thank you

0 Likes

mspeer
Consultant
Consultant

Hi!

 

1. To make this clear, i cannot confirm any problem by using relative texture paths.

 

2. For further help i need more information, but it looks as if you replaced the relative path by absolute paths.

a) There are at least 3 paths which can't all be stored by Maya: D:, N:, relative, would be interesting to check the Maya file.

b) Also "...finalV.001/... looks like a backup directory or something similar

 

3. "...old Autodesk Tutorial..."

- Check for Bonus Tools

 

4. "the functionality had been moved to the Hypershade."

- Nothing has been moved there, it's just an additional option where to set the project

It is recommended to set a project BEFORE opening and working with a scene.

0 Likes

mayanim8
Advocate
Advocate

This error appears to be a bug.

This occurs when a file is imported into a project from a location outside of the current project. 

If an image is imported into a scene file from a location outside of the project, the file address appears to stick to an absolute path.  

Even though the texture may appear on the geometry, the address in the Attribute Editor still points to the original location.  Regardless if the file exists.  

The texture can be seen and will render, however, using the Edit and View buttons in the Attribute editor, will result in an "invalid argument" error.  FCheck is still looking to the original location.

The File Path Editor does not fix this.

The only method to fix this error is to manually re-import the file after it has be moved to the correct project folder.

 

 

 

0 Likes

sean.heasley
Alumni
Alumni

Hi @mayanim8 

 

This has been tough to reproduce but I'm going to go ahead and log this with our developers anyway so they can look into it. If they know of a workaround/solution for this I'll be sure to update this thread with it.

 

 

0 Likes

mspeer
Consultant
Consultant
Accepted solution

Hi!

 

@sean.heasley 

@mayanim8  provided some files and this is the result.

There are 2 problems:

 

1. The original Maya scene-files (before moving) did contain only absolute paths and not relative paths, which looks like a user error.

So the paths cannot be resolved when the used project folder is at a different location.

 

BUT

2. The File Path Editor cannot resolve some of these paths, which looks like a bug in Maya.

If an image file is located directly in "sourceimages" and the path saved in the Maya scene points to an other absolute or local path, then Repath does not work correct.

The path will only be resolved partially, it can be seen in Viewport and the File Path Editor shows it as resolved, but the path saved in the Maya scene will not be changed.

 

Example:

Image placed in (local path) sourceimages\image.jpg cannot be resolved "correct" by File Path Editor, if

path saved in Maya file:

- T:\mayaproject\sourceimages\image.jpg

- T:\anywhere\image.jpg

- (local path) sourceimages\subfolder\image.jpg

 

It only works if the project set for Maya is T:\mayaproject or the same local path sourceimages\image.jpg is saved inside the Maya file.

 

If the image is placed inside a subfolder like sourceimages\subfolder\image.jpg it can always be resolved by using File PATH Editor.