PDA

View Full Version : "Convert File Paths to UNC" checkbox?


thatoneguy
06-20-2008, 12:57 AM
Can you toggle the "Convert File Paths to UNC" checkbox through maxscript?

magicm
06-20-2008, 01:07 AM
Here you go:

pathConfig.resolveUNC = true/false

Cheers,
Martijn

thatoneguy
06-20-2008, 01:14 AM
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 : (

thatoneguy
06-20-2008, 02:16 AM
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?

PiXeL_MoNKeY
06-20-2008, 03:46 PM
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

thatoneguy
06-20-2008, 07:02 PM
Just who I was hoping would show up. :D

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.

PiXeL_MoNKeY
06-20-2008, 07:12 PM
You may want to run a ATSOps.Refresh() after you do the changing to UNC.

-Eric

thatoneguy
06-21-2008, 08:06 AM
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.

CGTalk Moderation
06-21-2008, 08:07 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.