Notifications
Clear all

[Closed] "Convert File Paths to UNC" checkbox?

Can you toggle the “Convert File Paths to UNC” checkbox through maxscript?

7 Replies

Here you go:

pathConfig.resolveUNC = true/false

Cheers,
Martijn

Hahaha that reallllly freaks max out. Nothing gets updated in the interface and it still thinks it’s in MappedDrive land… but if I right click on a map and hit explore it sends me to the right place… so I think this works.

Thanks a million.

EDIT: Hmmm… doesn’t work with XRefs. Is there a way to convert everything in a scene to UNC?

I was looking at the atsops and it has a “convertselectedtoUNC()” function but I can’t figure out how to “select all” to make it happen.

EDIT EDIT: Also doesn’t change the output path : (

Just tried this and this did not work. Any ideas why?

 
fileArray = #()
ATSOps.Refresh()
ATSOps.GetFiles &fileArray --collect all scene files and paths
deleteItem fileArray 1 --remove the actual scene file path
 
for f in fileArray do
(
ATSOps.SelectFiles #(f)
ATSOps.ResolveSelectionToUNC()
)
 

Edit:
I threw in a print (atsops.numfilesselected()) and it said “0, 0, 1” where 1 was the only file it changed.

So for some reason it won’t select anything except for my output path… am I missing something?

A few things I noticed:

  1. Local drive(s) paths will not be resolved to UNC paths
  2. Use:

ATSOps.SelectFiles &fileArray
ATSOps.ResolveSelectionToUNC()
instead of this loop:
for f in fileArray do
(
ATSOps.SelectFiles #(f)
ATSOps.ResolveSelectionToUNC()
)
My tests showed the non-loop version was about 2.5-3 times faster.

-Eric

Just who I was hoping would show up.

I tried the loop free version but it only selected the last file. My loop unfortunately also only selected the last frame. And it let me run some debugging to discover it’s not selecting anything except for my output file.

The resolveUNC is working fine it’s just not selecting the files to resolve them.

You may want to run a ATSOps.Refresh() after you do the changing to UNC.

-Eric

I tried that as well. The problem though is the selecting part. Not the resolving to UNC part.

If I select them all manually in the window and execute the resolveselectedUNC it works great. And when I debug with a filesselected function it only says “1” which makes sense since it’s only changing one, the last one.