Notifications
Clear all

[Closed] select object with missing bitmaps

i don’t know what guys you are doing… i say it takes NOTHING:

delete objects
  for k=1 to 500 do 
  (
  	b = box()
  	mat = multimaterial numsubs:10
  	mat[9].diffusemap = bitmaptexture filename:"oops.bmp" 
  	b.mat = mat
  )
  
  fn getMissedTextureNodes = 
  (
  	fn collectFiles f list = append list f 
  	for node in objects collect
  	(
  		missed = #()
  		enumerateFiles node collectFiles missed #missing
  		if missed.count == 0 then dontcollect else node	
  	)
  )
  
  t1 = timestamp()
  nodes = getMissedTextureNodes()
  format "count:% time:%
" nodes.count (timestamp() - t1)
  -- count:500 time:64
2 Replies
(@polytools3d)
Joined: 10 months ago

Posts: 0

Max 2011
count:500 time:649

Max 2014
count:500 time:241

(@polytools3d)
Joined: 10 months ago

Posts: 0

Try this instead, with only 1 multimaterial, 10 subs, 10 mising textures (I previously mentioned I was testing with this setup)

(
 
 delete objects
 
 mat = multimaterial numsubs:10
 for j = 1 to 10 do
 (
 	mat[j].diffusemap = bitmaptexture fileName:"oops.png"
 )
 
 for k = 1 to 500 do box material:mat
 
 fn getMissedTextureNodes = 
 (
 	fn collectFiles f list = append list f 
 	for node in objects collect
 	(
 		missed = #()
 		enumerateFiles node collectFiles missed #missing
 		if missed.count == 0 then dontcollect else node	
 	)
 )
 
 t1 = timestamp()
 nodes = getMissedTextureNodes()
 format "count:% time:%
" nodes.count (timestamp() - t1)
 -- count:500 time:6216
   
 )

The problem, as I see it, is that this code (as well as the first I posted) checks for every node, when perhaps it would be more efficient to check for every material.

So in this case instead of doing 500 “enumerateFiles” checks we could just do it once for each material and then look for the nodes using these material.

i’ve specially made unique material for every node… as i said it has to be fast. just doesn’t take anything. and it works as i expected for max 2012:

count:500 time:67  

but for max 2014 (same code, same machine, same configuration, same set of plugins) i have:

count:500 time:833

i don’t have any explanation for that. probably they broke something again.

The code from Denis

max9(on virtual machine WinXP)
count:500 time:4125

max2009(on virtual machineWinXP)
count:500 time:1047

max2013
count:500 time:621

max2014
count:500 time:556

Thank you everybody for help, yours ideas are very helpful however in some cases it’s very slow. I see you gays don’t quite believe it can take so long for max to check node in this way . I test it on 10 different scenes, mostly it work very fast but sometimes is extremely slow, I don’t know why either. Maybe because this scenes was created on older versions of max.
Example:
387 objects
count:147 time:570209
File size is 2mb so I cant submit this scene here but for some of you don’t believe I can send this scene via email or post it elsewhere.

I check all your scripts and it seams the fastest version is first script from PolyTools3D
at least on scenes I tested already.

Regarding classinstance :
Thank You Denis for link, I found plenty of examples, however I want select objects which have specified modyfiers in simplest possible way. I use code, it’s very transparent but don’t work – it select only objects with first modyfiers then throw error, could you take a look, if
it required complex modifications then never mind. Thank you anyway.

—– select objects with uvwmap,meshsmooth

tsMods=getClassInstances #(uvwmap,meshsmooth)
nodes=#()
for m in tsMods do
(
join nodes (refs.dependentNodes m)
)
select nodes

I see you gays don’t quite believe it can take so long for max to check node in this way

shouldn’t that read “guys”

I do believe you

…File size is 2mb so I cant submit this scene here but for some of you don’t believe I can send this scene via email or post it elsewhere…
Would you please upload the files somewhere?

Thanks

Thank you so much for this nice thread!

I think it is very important also to find objects with just found textures, even if the texture is located on network. If a texture is located on a network location then in Asset tracking you see just that it is Network Path!

I’ve made a tool that checks the “missing” on network and local, “found” local and network and even in multimaterial and collor correct maps, dirt, and all other types of maps that Asset tracking is not displaying, but it takes a little long to find! In any case, I use it almost everyday.

I hope you can find a better solution then me!

Do you mean something like this?

(
-- Collect nodes & textures
nodes = for node in objects where (t = usedmaps node).count > 0 collect #(node, t)

-- Collect nodes only
nodes = for node in objects where (usedmaps node).count > 0 collect node
)

Oh, I was so happy to see this just in one line, but unfortunately it doesn’t find these textures from my interior scene

Here you can see full size image

1 Reply
(@polytools3d)
Joined: 10 months ago

Posts: 0

I see. I was unsure it would work in all cases, especially for network paths.

May I ask you something? What do you get if you select an object that uses one of those textures and call “usedmaps”?

usedmaps $

I ask because I am not sure if the code fails finding the textures, or giving you the full network path.

Page 2 / 2