DETECT THE STATUS OF THE TEXTURES

Like in asset browser: Missing, Network, OK, Found etc

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
artrender.info's picture

SOLVED

Thx all who participated!

artrender.info's picture

THE ONLY DIFFERENCE BETWEEN THESE 2 FUNCTIONS

the only difference, there is doesFileExist function which will skip textures that can actually return #Found (such as the ones that have no path and those where the path is wrong but the file itself is in the (sub)folder of the folder the maxfile is inside)

but the problem is with

     mystatus=ATSOps.GetFileSystemStatus  m.filename

artrender.info's picture

IN THIS FUNCTION

fn getmapsfromselection = 
 (
  for s in selection do 
  (
   if s.material!=undefined then 
   (
    newbitmaps=getclassinstances Bitmaptexture target:s.material
                      for b in newbitmaps do 
     if (finditem bitmaps_for_selection b==0) then append bitmaps_for_selection b
   )
  )
 
  for m in bitmaps_for_selection do
  (
   if m.filename!=undefined then 
   (
     mystatus=ATSOps.GetFileSystemStatus  m.filename
     print mystatus
 
   )
  )
 )

it was array with the textures

artrender.info's picture

ERROR

I get this error

AttachmentSize
error.jpg 140.03 KB
barigazy's picture

Yep. I don't know what's

Yep. I don't know what's bitmaps_for_selection.
Array variable or something else?

barigazy

barigazy's picture

I edited last fn

I edited last fn

barigazy

artrender.info's picture

EVEN TONS OF IFs don't help

if (atsops.GetFileSystemStatus m.filename)[1] == #missing
myStatus = "missing"
if (atsops.GetFileSystemStatus m.filename)[1] == #Ok
myStatus = "Ok"
if (atsops.GetFileSystemStatus m.filename)[1] == #Found
myStatus = "Found"
if (atsops.GetFileSystemStatus m.filename)[1] == #NetworkPath
myStatus = "NetworkPath"
if (atsops.GetFileSystemStatus m.filename)[1] == #Unknown
myStatus = "Unknown"
print myStatus

anyway UNKNOWN

artrender.info's picture

THANKS A LOT

BUT ANYWAY I get

#(#UNKNOWN)
#(#UNKNOWN)
#(#UNKNOWN)

In asset tracking I don't have UNKNOWN at all

artrender.info's picture

BUT THIS FUNCTION IS WORKING

atsops.GetFiles &fileList
-- Get missing files
missingFiles = for val in fileList where ((atsops.GetFileSystemStatus val)[1] == #missing) collect val

I don't know what's the problem!

barigazy's picture

I clean up code a bit

I clean up code a bit

fn getmapsfromselection bmpForSel:&bitmaps_for_selection = if selection.count != 0 do
(
	for s in selection where s.material != null do 
	(
		newbitmaps = getclassinstances Bitmaptexture target:s.material
		if newbitmaps.count != 0 do
		(
			for b in newbitmaps where (finditem bmpForSel b == 0) do append bmpForSel b
		--or u can use this : for b in newbitmaps do appendIfUnique bmpForSel b	
		)
		if bmpForSel.count != 0 do 
		(
			for m in bmpForSel where doesFileExist m.filename do 
			(
				mystatus = ATSOps.GetFileSystemStatus (m.filename)
				format "%\n" mystatus
			)
		)
	)
)

barigazy

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.