[Closed] ATSCustomDepsOps question
ATS automatically tracks all file dependencies those used with a scene (bitmaps, xrefs, presets, etc.)
but you can also specify a list of files (custom dependencies) which are not obvious for the system and used by your … whatever… tools for example (like most recently saved skin data file, or animation source files). this info probably makes sense only for you, but this is an exact purpose of custom deps files.
Can I use this to add some filenames which assetT. not recognize like path for some maps? As example:
meditMaterials[1] = Standard diffuseMap:(Camera_Map_Per_Pixel zbuffer:(openbitmap @"C:\Users\BGA\Documents\3dsMax\sceneassets\images\BARK5.jpg"))
Is it posible to repath this using assetT. or not?
you can use any file… that’s actually the goal. and by the theory you can use any ATS service working with them (remap, source control, update, etc.)
Can you show me how to use remap on my example. I know how to add the filename to ATSCDOps but ATSOps after that … no.
Or is it better way to add path directly with
<bool>ATSOps.AddFiles <index>ProviderIndex <&filename array>FileList <&TSTR>Comment IsHidden:<&bool array>
What represent “Comment” argument?
fn fillATSCustomDeps dir: =
(
local filelist = getfiles (dir+"\*.*")
if ATSCustomDepsOps.NumFiles() != 0 do ATSCustomDepsOps.RemoveAll()
if (ATSOps.GetFiles &assetlist) != 0 do (filelist = for f in filelist where findItem assetlist f == 0 collect f)
for f in filelist do ATSCustomDepsOps.AddFile f
)
fillATSCustomDeps dir:@"C: emp\images"
Using this result is alway false.
filelist = getfiles (@"C: emp\images\*.*")
if (ATSOps.GetFiles &assetlist) != 0 do (filelist = for f in filelist where findItem assetlist f == 0 collect f)
ATSOps.AddFiles 1 filelist "comment" IsHidden:off
Asset Manager recognize Camera_Map_Per_Texture map but AssetTracking not.
Now the question is how to repath path which asset tracking not see using maps included in
“Custom Dependencies” list?
This is not funny.:banghead: Why would I asked this if I have not already tried. This is the 2nd day of trying. Please Denis …
resetmaxfile #noprompt
ATSOps.NumFiles() -- 0
ATSCustomDepsOps.NumFiles() -- 0
for f in (getfiles (getdir #scripts + @"\*.ms")) do ATSCustomDepsOps.AddFile f
ATSOps.Refresh()
ATSOps.GetFiles &ff
ff
Thanks Denis. That’s easy part. Now I need to find out how this works for map classes like:
#MAX MAPS
Camera_Map_Per_Pixel, Bitmaptexture, Normals_Bumpmap, Texture_Lookup_2d, Depth_of_Field___Bokeh, Contour_PS__contour, GlaretextureMap, Substance, Environment_Probe_Gray_Ball__mi, Environment_Probe_Chrome_Ball__mi, Environment_Background_Camera_Map__mi, Facade__lume, Mist__lume, Vector_Map
#VRAY MAPS
VRayBmpFilter, VRayHDRI, VRayGLSLTex, VRayPtex.
Why ATSOps.AddFilles() not works?
what doesn’t work? do you want to add files with no dependencies in the scene?
Yes. But I suppose even then all “invisible” map classes can’t be remaped by A.T. Am I right?
I noticed when use getclassinstances for previously listed map classes and then use setPropery() with correct filename most maps will be remaped and some not.
I don’t know why this happens? Also this method is very slow.
That’s why I started to explore ATSOps methods.
the system can’t remap a path (filename pointer) if it doesn’t know where it is.
your dialog with the system might look like that:
U: – may i define some filenames which you don’t know about?
S: – sure…
U: – could you please keep a record about them?
S: – no problem. i will
U: – if i would ask you to change them later what do you do?
S: – f*ck you! how do i know where you hide them?
Fair answer, especially last one :):applause:
What about remaping maps by setProperty fn. Why some maps reject to remap with correct new filename. Is this max bug, and how to avoid it?
what does it really mean? it means you have the system to remember you… do something that it has to care for…
there is a thing that i’ve never used or even tried. that’s a new feature in the pblock params.
it’s a parameter of type #filename (3ds Max 2010 and higher.
theoretically the putting anything with this type to any param block has to feel the system nervous.
Yup.
allBTex = (getclassinstances bitmaptex)
setProperty allBTex[1] #filename (some file name)
setProperty allBTex[2] #filename (some file name) etc.
…
or directly
allBTex[1].filename = (some file name)
allBTex[1].filename = (some file name) etc.
Alternative for this will be ei. 3rd way?
no. filename property is not about it.
there is a new (five years old is still young for me) pblock parameter type.
see Scripted Plug-in Clauses -> parameters -> #filename
it’s not about property name, it’s about the type
Sorry I did not understand first time.
From mxs help:
[i]when the parameter is of type #filename, to handle the parameter as an asset
you also need to specify assettype:<asset_type> where argument is one
of the following enums:
#Other
#Bitmap
#XRef
#Photometric
#Animation
#VideoPost
#BatchRender
#ExternalLink
#RenderOutput
#PreRenderScript
#PostRenderScript
#Sound
#Container[/i]
How you suggest to use it?
well.
the #filename type has to force the max at least to check the filename existence. and to keep a record – “Oops! i couldn’t find it…” after that hopefully the max knows where it lost the record. so hopefully it knows where it can find a record to remap it in a case if something happens
Wow. How do you know all this cheating. I understand what you saying but what I not understad is “check the filename existence” of what? Map class instance? Asset file?
Can you show some example?
the help says that:
[i]when the parameter is of type #filename, to handle the parameter as an asset you also need to specify assettype:<asset_type> where argument is one…
[/i]but it doesn’t matter what type i specify, the system doesn’t put the file into assets file list. why? i have no idea. probably you have to ask this question to developers.
Again dead end.:sad: I was spent whole week only on this:surprised.
Ok I will send you my tool to see what I have for now.
Also to change paths I tried this:
Let’s say my file is located @“D:\myfiles est.max”
This file use maps from random locations.
-- find all external filenames
fileProperties.getItems "External Dependencies"
----------------------------------------------------------------
ATSOps.CloseProject 1
-- new maps folder (with all scene maps)
ATSOps.OpenProject 1 @"C: emp\maps\"
ATSOps.setpath "" -- strip paths
ATSOps.GetFile &filelist
deletItem filelist (@"D:\myfiles est.max")
ATSOps.selectFiles filelist
ATSOps.ResolveSelectionToAbsolute()
As result all maps will be remaped to C: emp\maps(some map).(some extension)
In most cases this will crash max.